id int32 3 295 | prompt large_stringlengths 102 236 | prompt_original large_stringlengths 34 726 | intent large_stringlengths 29 1.52k | main_tf large_stringlengths 162 4.67k | checks_rego large_stringlengths 171 6.45k | plan_json large_stringlengths 1.59k 40.6k | prompt_clarified large_stringlengths 161 1.4k |
|---|---|---|---|---|---|---|---|
57 | I need my main domain to direct visitors to a specific place where our app is running, keeping the setup straightforward. | Set up a non-alias aws_route_53 record that is linked to an aws_route53_zone resource named "example53.com" (Terraform resource name "example53") | Has one "aws_route53_zone" resource
with "name" set to "example53.com"
Has one "aws_route53_record" resource
with "name"
with "type"
with "ttl"
with "records"
with "zone_id" referencing the "aws_route53_zone" resource
| provider "aws" {
region = "us-east-1"
}
resource "aws_route53_zone" "example53" {
name = "example53.com"
}
resource "aws_route53_record" "example53_A" {
zone_id = aws_route53_zone.example53.zone_id
name = "example53.com"
type = "A"
ttl = "300"
records = ["192.0.2.1"]
} | package terraform.validation
default is_configuration_valid = false
default is_valid_r53_zone = false
default is_valid_r53_record = false
# Validate aws_route53_zone resource
is_valid_r53_zone {
some i
resource := input.configuration.root_module.resources[i]
resource.type == "aws_route53_zone"
resource.ex... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_route53_record.example53_A","mode":"managed","type":"aws_route53_record","name":"example53_A","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":2,"values":{"alias":[],"cidr_routing_pol... | I need my main domain example53.com to direct visitors to a specific place where our app is running, keeping the setup straightforward. Everything should be set up in us-east-1. Call the domain setup example53 and the entry that points visitors to the app example53_A. Visitors' lookups should be remembered for 300 seco... |
12 | I need an easy way to run and manage a web app without dealing with a lot of server setup, and it should scale automatically and run with the right access to other parts of our system. | Create an elastic beanstalk WebServer environment with a elastic beanstalk application. Name the iam_role "eb_ec2_role", the instance profile "eb_ec2_profile", and the elastic beanstalk application "my_application". Attach the AWS managed policy "arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier" to the role with an a... | Has one "aws_iam_role" resource
with "name"
with "assume_role_policy" and "Service" set to "ec2.amazonaws.com"
Has one "aws_iam_role_policy_attachment" resource
with "role" referencing the "aws_iam_role"
with "policy_arn" set to "arn:aws:iam::aws:policy/AWSElasticBeanstalkWebTier"
Has one "aws_iam_ins... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
# IAM role for Elastic Beanstalk EC2 instances
resource "aws_iam_role" "eb_ec2_role" {
name = "elastic_beanstalk_ec2_role_... | package terraform.validation
default is_configuration_valid = false
default is_valid_iam_instance_profile = false
default is_valid_iam_role = false
default is_valid_iam_role_policy_attachment = false
default is_valid_eb_app = false
default is_valid_eb_env = false
is_valid_iam_role {
some i
resource :... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elastic_beanstalk_application.my_application","mode":"managed","type":"aws_elastic_beanstalk_application","name":"my_application","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"v... | I need an easy way to run and manage a web app without dealing with a lot of server setup, and it should scale automatically and run with the right access to other parts of our system. Put it all in us-east-1. The app should be named my-three-tier-app and the web-facing piece my-web-tier-env, running on 64bit Amazon Li... |
140 | I need our data store to stay fast and available for people across the country, even if one area has an outage. | Create a DynamoDB table with replicas in us-east-2 and us-west-2 | Has one "aws_dynamodb_table" resource
with one "replica"
with one "region_name" = "us-east-2"
with one "replica"
with one "region_name" = "us-west-2" | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
# Configure the AWS Provider
provider "aws" {
region = "us-east-1"
}
resource "aws_dynamodb_table" "example" {
name = "example"
hash_key = "TestTableHashKey"
billing_mode = "PAY_PER_REQUEST"
stream_enabled = true
stream_view_ty... | package main
import future.keywords.in
default allow = false
# Required replica regions
required_regions := {"us-east-2", "us-west-2"}
# Check for DynamoDB table creation
dynamodb_table_created(resources) {
some resource in resources
resource.type == "aws_dynamodb_table"
resource.change.actions[_] == "create"
}
# ... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_dynamodb_table.example","mode":"managed","type":"aws_dynamodb_table","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"attribute":[{"name":"TestTableHashK... | I need our data store to stay fast and available for people across the country, even if one area has an outage. Call it "example" and key records off "TestTableHashKey". Set it up primarily in us-east-1, with copies in us-east-2 and us-west-2. |
125 | I need a reliable way to collect activity data from our messaging system and funnel it into a storage setup for later analysis, and it should all run in one of our main regions while keeping the network setup straightforward and secure. | Create a managed MSK cluster in us-east1 logging to a Kinesis Firehose | Has one "aws_msk_cluster" resource
with one "logging_info"
with one "broker_logs"
with one "firehose"
with one "enabled" = true | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "vpc" {
cidr_block = "192.168.0.0/22"
}
data "aws_availability_zones" "azs" {
state = "available"
... | package main
import future.keywords.in
default allow = false
# Check if any MSK cluster is being created
msk_cluster_created(resources) {
some resource in resources
resource.type == "aws_msk_cluster"
resource.change.actions[_] == "create"
}
# Check if Kinesis Firehose logging is enabled for broker logs
firehose_log... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"outputs":{"bootstrap_brokers_tls":{"sensitive":false},"zookeeper_connect_string":{"sensitive":false}},"root_module":{"resources":[{"address":"aws_iam_role.firehose_role","mode":"managed","type":"aws_iam_role","name":"firehose_role","provider_name":... | I need a reliable way to collect activity data from our messaging system and funnel it into a storage setup for later analysis, and it should all run in one of our main regions while keeping the network setup straightforward and secure.
Put everything in us-east-1. The private network should use the range 192.168.0.0/... |
114 | I need a way to speed up repeated data lookups so our main data store doesn’t get hammered under load. | Provide a resource to reduce the number of database calls, using the memcached engine. | requires cluster id, engine=memcached, node_type, num_cache_nodes, parameter_group_name | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_elasticache_cluster" "example" {
cluster_id = "cluster-example"
engine = "memcached"
node_type = "cache.m... | package main
import future.keywords.in
default allow = false
aws_elasticache_cluster_valid(resources) {
some resource in resources
resource.type == "aws_elasticache_cluster"
resource.change.after.engine == "memcached"
}
# Aggregate all checks
allow {
aws_elasticache_cluster_valid(input.resource_chan... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elasticache_cluster.example","mode":"managed","type":"aws_elasticache_cluster","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"auto_minor_version_upgrad... | I need a way to speed up repeated data lookups so our main data store doesn't get hammered under load. Put it in us-east-1. Use cache.m4.large sizing with 2 of them, and have it listen on port 11211. Call it example. |
71 | I need to add a pool of machines that can join our container platform, scale up and down automatically, and have whatever access they need to pull images and handle networking, while keeping the setup simple and reliable. | Create a Terraform script for an AWS EKS node group (with name attribute set to "example") linked to a specific EKS cluster (with name attribute set to "example"). Define a resource with details including the node group name, node role ARN, and subnet IDs. Configure scaling parameters (desired size is 1, max size is 2,... | has one "aws_eks_node_group" resource
with one "cluster_name"
with one "node_group_name"
with one "node_role_arn"
with one "subnet_ids"
with one "scaling_config" containing:
one "desired_size"
one "max_size"
one "min_size"
with one "update_config" containing:
one "max_unavailable"
with dependencies on three IAM role po... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
data "aws_availability_zones" "available" {
state = "available"
... | package terraform.validation
default has_aws_eks_node_group_example = false
has_aws_eks_node_group_example {
node_group := input.planned_values.root_module.resources[_]
node_group.type == "aws_eks_node_group"
node_group.values.cluster_name == input.planned_values.root_module.resources[_].values.name
n... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_eks_cluster.example","mode":"managed","type":"aws_eks_cluster","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"bootstrap_self_managed_addons":true,"enab... | I need to add a pool of machines that can join our container platform, scale up and down automatically, and have whatever access they need to pull images and handle networking, while keeping the setup simple and reliable.
Put everything in us-east-1. The private network should be called "main" and use 10.0.0.0/16, wit... |
52 | I need to pull information from a site our system can’t reach directly, and it should grab the content automatically on a regular basis while going through our own network path for security. | Generate a Kendra data source resource with a proxy configuration | Has one "aws_iam_role" resource, one "aws_kendra_index" resource, and one "aws_kendra_data_source" resource with a "proxy_configuration" block | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_iam_role" "role" {
name = "Kendra-Role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statemen... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"kendra.amazonaws.com")
}
has_valid_kendra_index {
some i
... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_iam_role.role","mode":"managed","type":"aws_iam_role","name":"role","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"assume_role_policy":"{\"Statement\":[{\"Action\":\"st... | I need to pull information from a site our system can’t reach directly, and it should grab the content automatically on a regular basis while going through our own network path for security. Put everything in us-east-1. The network path it goes through is at a.example.com on port 443. Name the search setup and the cont... |
279 | I need a private network for our systems that can also reach the public internet, and it should be set up in the general area where most of our users are located. | creates a VPC with a CIDR block and DNS hostnames enabled, and an internet gateway in the AWS us-east-2 region, both tagged with names "vpc" and "ig" respectively, both with the Terraform resource name "_". | Has one "aws_vpc" resource:
with a specified "cidr_block"
with "enable_dns_hostnames" set to true
Has one "aws_internet_gateway" resource:
with "vpc_id" referencing the "aws_vpc" resource by its ID
with a "tags" map that is not null, including at least a "Name" key with a value | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.16"
}
}
required_version = ">= 1.2.0"
}
# Define the provider block for AWS
provider "aws" {
region = "us-east-2" # Set your desired AWS region
}
resource "aws_vpc" "_" {
cidr_block = "10.0.0.0/1... | package terraform.validation
# Set default validation states
default is_valid_vpc = false
default is_valid_internet_gateway = false
# Validate aws_vpc resource
is_valid_vpc {
some i
resource := input.configuration.root_module.resources[i]
resource.type == "aws_vpc"
resource.expression... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_internet_gateway._","mode":"managed","type":"aws_internet_gateway","name":"_","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"region":"us-east-2","tags":{"Name":"ig"},"t... | I need a private network for our systems that can also reach the public internet, and it should be set up in us-east-2 since that's the general area where most of our users are located. The network should use the address range 10.0.0.0/16. Name the pieces of this setup with just an underscore (_). |
44 | We need a way to collect a steady stream of app events, move them reliably into our search and analytics system, and keep everything running inside our private network for security. | Generate a Kinesis Firehose Delivery Stream with a Elasticsearch Destination With VPC | Has one "aws_iam_role" resource, one "aws_s3_bucket" resource, one "aws_elasticsearch_domain" resource, one "aws_vpc" resource, two "aws_subnet" resources, one "aws_security_group," and one "aws_kinesis_firehose_delivery_stream" resource with a "vpc_config" block within the "elasticsearch_configuration" block | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "bucket" {
bucket_prefix = "my-bucket-"
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"firehose.amazonaws.com")
}
has_valid_bucket {
some i
re... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elasticsearch_domain.test_cluster","mode":"managed","type":"aws_elasticsearch_domain","name":"test_cluster","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"cluster_confi... | We need a way to collect a steady stream of app events, move them reliably into our search and analytics system, and keep everything running inside our private network for security. Put it all in us-east-1.
The private network should be called main and use 10.0.0.0/16, with two address ranges: first on 10.0.1.0/24 and... |
216 | I need our video site to load quickly for people in many different countries, with the files stored in one place but delivered efficiently and tied to our own domain, while keeping things reasonably secure. | The infrastructure for a video streaming site that distribute video content globally. Accomplish this using the following resources: AWS CloudFront origin access control, AWS CloudFront distribution, AWS Route53 zone, AWS Route53 record, and AWS S3 bucket. Add any necessary resources. Allow and cache only GET and HEAD,... | have one "aws_cloudfront_origin_access_control" resource
with "name" argument
with "origin_access_control_origin_type" with value "s3"
with "signing_behavior" argument
with "signing_protocol" argument
have one "aws_cloudfront_distribution" resource
with "origin.domain_name" argument linking to "aws_... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "video_content" {
bucket_prefix = "video-content-"
}
locals {
s3_origin_id = "s3_video_content_o... | package netflix_middle
import data.set
import rego.v1
bucket_valid(bucket) := true
access_control_valid(access_control) if {
access_control.expressions.name
access_control.expressions.origin_access_control_origin_type.constant_value == "s3"
access_control.expressions.signing_behavior
access_control.expressions.s... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_cloudfront_distribution.my_distribution","mode":"managed","type":"aws_cloudfront_distribution","name":"my_distribution","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"a... | I need our video site to load quickly for people in many different countries, with the files stored in one place but delivered efficiently and tied to our own domain, while keeping things reasonably secure.
Put everything in us-east-1. The storage should be named with the prefix video-content-, and I'll refer to it as... |
16 | I need a simple way to manage new releases of my app so old versions don’t pile up, but still keep things running smoothly and securely. | Create an Elastic Beanstalk application with an app version lifecycle | Has one "aws_elastic_beanstalk_application" resource
with "name"
with "appversion_lifecycle" block
Has one "aws_iam_role" resource
with "name"
with "assume_role_policy" and "Service" set to "elasticbeanstalk.amazonaws.com" | provider "aws" {
region = "us-east-1"
}
resource "aws_iam_role" "beanstalk_service" {
name = "tf-test-beanstalk-service-role"
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
Action = "sts:AssumeRole",
Effect = "Allow",
Principal = {
Servi... | package terraform.validation
default is_configuration_valid = false
default is_valid_eb_app = false
default is_valid_iam_role = false
is_valid_eb_app {
some i
resource := input.configuration.root_module.resources[i]
resource.type == "aws_elastic_beanstalk_application"
resource.expressions.nam... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elastic_beanstalk_application.tftest","mode":"managed","type":"aws_elastic_beanstalk_application","name":"tftest","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"appvers... | I need a simple way to manage new releases of my app so old versions don't pile up, but still keep things running smoothly and securely. Set it up in us-east-1. The app is called tf-test-name, and I refer to it as tftest in my setup. Only keep up to 128 versions around. |
15 | I need a simple way to run my app in the cloud so it can grow as usage increases, without me having to manage the underlying servers. | Provision a resource to deploy and scale a web application that was developed with supported programming languages. | Has one "aws_elastic_beanstalk_application" resource
with "name" | provider "aws" {
region = "us-east-1"
}
resource "aws_elastic_beanstalk_application" "tftest" {
name = "tf-test-name"
description = "tf-test-desc"
} | package terraform.validation
default is_configuration_valid = false
default is_valid_eb_app = false
is_valid_eb_app {
some i
resource := input.configuration.root_module.resources[i]
resource.type == "aws_elastic_beanstalk_application"
resource.expressions.name
}
is_configuration_valid {
is... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elastic_beanstalk_application.tftest","mode":"managed","type":"aws_elastic_beanstalk_application","name":"tftest","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"appvers... | I need a simple way to run my app in the cloud so it can grow as usage increases, without me having to manage the underlying servers. Set it up in us-east-1. The app should be named tf-test-name, and I refer to it as tftest in my setup. |
47 | I need a simple place where I can send live video feeds so they can be stored briefly and accessed by whatever needs to process them. | Generate a basic Kinesis Video Stream resource | Has one "aws_kinesis_video_stream" resource | provider "aws" {
region = "us-east-1"
}
resource "aws_kinesis_video_stream" "default" {
name = "terraform-kinesis-video-stream"
data_retention_in_hours = 1
device_name = "kinesis-video-device-name"
media_type = "video/h264"
tags = {
Name = "terraform-kinesis... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_kinesis_video_stream {
some i
resource := input.planned_values.root_module.resources[i]
resource.type == "aws_kinesis_video_stream"
resource.values.name
}
has_valid_resources {
has_valid_kinesis_video_... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_kinesis_video_stream.default","mode":"managed","type":"aws_kinesis_video_stream","name":"default","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"data_retention_in_hours... | I need a simple place where I can send live video feeds so they can be stored briefly and accessed by whatever needs to process them. Put it in us-east-1. The feeds are video/h264, and they only need to be kept for 1 hour. Refer to it as default. |
111 | I want a shared workspace where our team can run experiments and build models in a controlled environment that ties into our internal network and keeps permissions tight. | Create a SageMaker Domain resource. | Has a sagemaker domain resources which requires a an iam role and a subnet | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "example" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "example" {
vpc_id = aws_vpc.example.id
cidr_block = "10.0.1.0/24"
... | package main
import future.keywords.in
default allow = false
aws_sagemaker_domain_valid(resources) {
some resource in resources
resource.type == "aws_sagemaker_domain"
}
aws_iam_role_valid(resources) {
some resource in resources
resource.type == "aws_iam_role"
}
aws_vpc_valid(resources) {
some... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_iam_role.example","mode":"managed","type":"aws_iam_role","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"assume_role_policy":"{\"Statement\":[{\"Action\... | I want a shared workspace where our team can run experiments and build models in a controlled environment that ties into our internal network and keeps permissions tight. Put everything in us-east-1. The internal network should use the address range 10.0.0.0/16, with a smaller slice of 10.0.1.0/24 for the workspace to ... |
119 | I need a super fast caching layer in front of our data store to cut down read times, but I want to keep the setup minimal and easy to manage. | Create a cluster with dax.r4.large and replication factor = 1. | require a cluster name, iam_role_arn, node_type, replication factor | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_iam_role" "example" {
name = "redshift_role"
assume_role_policy = jsonencode({
Version = "2012-10-17",
Statement = [
{
... | package main
import future.keywords.in
default allow = false
# Check if the AWS DynamoDB table is being created in us-east-1
aws_dax_cluster_valid(resources) {
some resource in resources
resource.type == "aws_dax_cluster"
resource.change.after.node_type == "dax.r4.large"
resource.change.after.replica... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_dax_cluster.bar","mode":"managed","type":"aws_dax_cluster","name":"bar","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"availability_zones":null,"cluster_endpoint_encryp... | I need a super fast caching layer in front of our data store to cut down read times, but I want to keep the setup minimal and easy to manage. Put it in us-east-1 and keep it to just 1 node of the r4.large size. Name the caching layer "bar" and the permissions role it uses "example". |
258 | I need a small database for an app we’re testing, but it should be tuned so it can handle heavier in‑memory workloads without slowing down. | create a memory optimized PostgresSQL | Has one "aws_db_instance" resource
with one "allocated_storage" minimun value is 20
with one "engine" with value "postgres"
with one "instance_class" with valid memory-optimized class
with one "password"
with one "username" | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_db_instance" "default" {
allocated_storage = 20
engine = "postgres"
instance_class = "db.z1d.micro"
username ... | package terraform.validation
default is_valid_db_instance = false
# Rule to check if a valid aws_db_instance exists
is_valid_db_instance {
resource := input.configuration.root_module.resources[_]
resource.type == "aws_db_instance"
has_required_db_arguments
}
# Helper rule to check if all requ... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_db_instance.default","mode":"managed","type":"aws_db_instance","name":"default","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":2,"values":{"allocated_storage":20,"allow_major_versio... | I need a small database for an app we're testing, but it should be tuned so it can handle heavier in-memory workloads without slowing down. Put it in us-east-1 and give it 20 GB of storage. Name it "default". It should run Postgres, with the login "foo" and the password "foobarbaz". |
13 | I need a reusable setup blueprint for one of our apps so we can spin up environments consistently without doing all the settings by hand. | Create a template of an elastic beanstalk application | Has one "aws_elastic_beanstalk_application" resource
with "name"
Has one "aws_elastic_beanstalk_configuration_template" resource
with "name"
with "application" referencing the "aws_elastic_beanstalk_application" resource
with "solution_stack_name" | provider "aws" {
region = "us-east-1"
}
resource "aws_elastic_beanstalk_application" "tftest" {
name = "tf-test-name"
description = "tf-test-desc"
}
resource "aws_elastic_beanstalk_configuration_template" "tf_template" {
name = "tf-test-template-config"
application = aws_elasti... | package terraform.validation
default is_configuration_valid = false
default is_valid_eb_app = false
default is_valid_eb_app_template = false
is_valid_eb_app {
some i
resource := input.configuration.root_module.resources[i]
resource.type == "aws_elastic_beanstalk_application"
resource.expression... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elastic_beanstalk_application.tftest","mode":"managed","type":"aws_elastic_beanstalk_application","name":"tftest","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"appvers... | I need a reusable setup blueprint for one of our apps so we can spin up environments consistently without doing all the settings by hand. Everything should be in us-east-1. The app is called tf-test-name and the blueprint should be named tf-test-template-config. It should run on "64bit Amazon Linux 2023 v4.0.9 running ... |
287 | I want all the systems inside our private network to automatically use a specific set of name lookups, so we don’t have to configure that manually on each machine. | creates DHCP options named "pike" for an AWS VPC, specifying Google's DNS servers (8.8.8.8 and 8.8.4.4), and then associates these DHCP options with a specified VPC | Has one "aws_vpc_dhcp_options" resource:
Specifies Google's DNS servers (8.8.8.8 and 8.8.4.4) as the DNS servers for the DHCP options
Tagged with "permissions" to categorize or specify its role or access levels within the infrastructure
Has one
"aws_vpc_dhcp_options_association" resource:
Associates the "aws_vpc_dhcp... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.16"
}
}
required_version = ">= 1.2.0"
}
# Define the provider block for AWS
provider "aws" {
region = "us-east-2" # Set your desired AWS region
}
resource "aws_vpc_dhcp_options_association" "pike" {
dhcp_... | package terraform.validation
# Set default validation states
default is_valid_dhcp_options = false
default is_valid_dhcp_options_association = false
# Validate aws_vpc_dhcp_options resource
is_valid_dhcp_options {
some i
resource := input.configuration.root_module.resources[i]
resource.type =... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_vpc_dhcp_options.pike","mode":"managed","type":"aws_vpc_dhcp_options","name":"pike","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"domain_name":null,"domain_name_server... | I want all the systems inside our private network to automatically use a specific set of name lookups, so we don't have to configure that manually on each machine. Set it up in us-east-2, name it pike, use the name servers 8.8.8.8 and 8.8.4.4, and label it with pike as permissions. In the code, label the lookup setting... |
101 | I want a single place that warns me when one of my existing performance checks starts looking bad, so I don’t have to monitor each one separately. | Create a CloudWatch Composite Alarm resource. | Creates an aws_cloudwatch_composite_alarm which requires at least one other aws_cloudwatch_metric_alarm | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_cloudwatch_composite_alarm" "example" {
alarm_name = "example-composite-alarm"
alarm_rule = <<EOF
ALARM(${aws_cloudwatch_metric_alarm.... | package main
import future.keywords.in
default allow = false
# Check if AWS CloudWatch Composite Alarm is being created
aws_cloudwatch_composite_alarm_valid(resources) {
some resource in resources
resource.type == "aws_cloudwatch_composite_alarm"
}
# Aggregate all checks
allow {
aws_cloudwatch_composite... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_cloudwatch_composite_alarm.example","mode":"managed","type":"aws_cloudwatch_composite_alarm","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"actions_ena... | I want a single place that warns me when one of my existing performance checks starts looking bad, so I don't have to monitor each one separately. Everything is in us-east-1. The existing check I care about is the one I call foobar, named terraform-test-foobar5: it looks at average CPU utilization and counts as bad whe... |
214 | I need a way to deliver our site’s video content so that people around the world can load it quickly, while keeping things simple and making sure it only works in the countries we support. | The infrastructure for a video streaming site that distribute video content globally. Accomplish this using AWS CloudFront and AWS S3. Allow and cache only GET and HEAD, use viewer_protocol_policy "allow-all", and add a geo restriction with a list of locations. | have one "aws_cloudfront_origin_access_control" resource
with "name" argument
with "origin_access_control_origin_type" with value "s3"
with "signing_behavior" argument
with "signing_protocol" argument
have one "aws_cloudfront_distribution" resource
with "origin.domain_name" argument linking to "aws_s3... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "video_content" {
bucket_prefix = "video-content-"
}
resource "aws_s3_object" "put_website" {
bu... | package netflix_high
import rego.v1
bucket_valid(bucket) := true
distribution_valid(distribution, bucket) if {
some origin in distribution.expressions.origin
bucket.address in origin.domain_name.references
some cache_behavior in distribution.expressions.default_cache_behavior
{method... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_cloudfront_distribution.my_distribution","mode":"managed","type":"aws_cloudfront_distribution","name":"my_distribution","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"a... | I need a way to deliver our site's video content so that people around the world can load it quickly, while keeping things simple and making sure it only works in the countries we support.
Put everything in us-east-1. The storage holding the video content should have names starting with video-content-, and I'll refer ... |
112 | I need to give one of our team members their own workspace in our data science environment so they can run experiments without affecting anyone else. | Create a SageMaker user profile resource | Has a sagemaker user profile resource which depends on a sagemaker domain resource | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "example" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "example" {
vpc_id = aws_vpc.exampl... | package main
import future.keywords.in
default allow = false
aws_sagemaker_domain_valid(resources) {
some resource in resources
resource.type == "aws_sagemaker_domain"
}
aws_iam_role_valid(resources) {
some resource in resources
resource.type == "aws_iam_role"
}
aws_vpc_valid(resources) {
some... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_iam_role.example","mode":"managed","type":"aws_iam_role","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"assume_role_policy":"{\"Statement\":[{\"Action\... | I need to give one of our team members their own workspace in our data science environment so they can run experiments without affecting anyone else. Put everything in us-east-1. The environment should sit on a private network range of 10.0.0.0/16 with a smaller range of 10.0.1.0/24 inside it. Name the environment, the... |
229 | I want a small, low-cost setup that can run a basic website with minimal effort, and it should be easy to get started without managing a lot of underlying pieces. | create AWS Lightsail with WordPress blueprint | have one "aws_lightsail_instance" resource
with "name" argument
with "availability_zone" argument
with "blueprint_id" = wordpress
with "bundle_id" argument | provider "aws" {
region = "us-east-1"
}
resource "aws_lightsail_instance" "custom" {
name = "custom"
availability_zone = "us-east-1b"
blueprint_id = "wordpress"
bundle_id = "nano_2_0"
} | package terraform.validation
default has_valid_lightsail_instance = false
# Main rule to check for a valid aws_lightsail_instance
has_valid_lightsail_instance {
resource := input.planned_values.root_module.resources[_]
resource.type == "aws_lightsail_instance"
resource.values.name
resource.values.avai... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_lightsail_instance.custom","mode":"managed","type":"aws_lightsail_instance","name":"custom","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"add_on":[],"availability_zone... | I want a small, low-cost setup that can run a basic website with minimal effort, and it should be easy to get started without managing a lot of underlying pieces. Put it in us-east-1, specifically in the us-east-1b zone. Name it "custom". It should come ready with WordPress, and use the "nano_2_0" size plan. |
142 | I need a place to store structured data that can handle a steady, predictable amount of traffic without slowing down. | Create a DynamoDB table with read and write capacity both set to 10. | Has one "aws_dynamodb_table" resource
with one "read_capacity" = 10
with one "write_capacity" = 10 |
provider "aws" {
region = "us-east-1"
}
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "GameScores"
billing_mode = "PROVISIONED"
read_capacity = 10
write_capacity = 10
hash_key = "UserId"
range_key = "GameTitl... | package main
import future.keywords.in
default allow = false
# Check for DynamoDB table creation
dynamodb_table_created(resources) {
some resource in resources
resource.type == "aws_dynamodb_table"
resource.change.actions[_] == "create"
}
# Check if read and write capacity are both set to 10
capacity_valid(resource... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_dynamodb_table.basic-dynamodb-table","mode":"managed","type":"aws_dynamodb_table","name":"basic-dynamodb-table","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"attribute... | I need a place to store structured data that can handle a steady, predictable amount of traffic without slowing down. Put it in us-east-1. Call it GameScores, and have it organized by UserId and GameTitle. It should have read and write capacity of 10 each. |
3 | Our main data store is too slow for people overseas, so I want to spread read traffic across a few copies in different parts of the world while keeping things reliable. | Using route 53 resources, configure a weighted routing policy that splits users between three db_instances that are replicas of a main db_instance. Provision the three replica instances in "us-east-1", "eu-central-1", and "ap-southeast-1". Provision the zone and main db_instance in "us-west-1". Call the zone "main", th... | Has one "aws_route53_zone" resource
with "name"
Has a "aws_db_instance" resource
with "identifier" set to "master"
with "instance_class"
with "allocated_storage"
with "engine"
with "username"
with "password"
with "backup_retention_period" set to a non-zero number
Has multiple "aws_db_i... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
configuration_aliases = [ aws.main, aws.us_east, aws.eu_central, aws.ap_southeast ]
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
alias = "main"
region = "us-west-2"
}
provider "aws" {
... | package terraform.validation
default is_configuration_valid = false
default is_valid_r53_zone = false
default is_valid_r53_record_us = false
default is_valid_r53_record_eu = false
default is_valid_r53_record_ap = false
default is_valid_db_instance_main = false
default is_valid_db_instance_replicaus = false
defa... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_db_instance.primary","mode":"managed","type":"aws_db_instance","name":"primary","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":2,"values":{"allocated_storage":20,"allow_major_versio... | Our main data store is too slow for people overseas, so I want to spread read traffic across a few copies in different parts of the world while keeping things reliable.
The main one lives in us-west-2 and should be named "master", running postgres with 20 GB of storage, an admin login of "dbadmin" with the password "y... |
81 | I need to place a new file into our cloud storage in a way that keeps things simple and lets me control where it goes. | Craft a Terraform configuration for creating an AWS S3 bucket object. Define an S3 bucket object (with value "object") with specific attributes including the bucket name (with value "your_bucket_name"), object key (with value "new_object_key"), and the path to the source file (with value "path/to/file"). | Resource "aws_s3_bucket_object"
has one "bucket"
has one "key"
has one "source"
has one "etag" | provider "aws" {
region = "us-west-1"
}
resource "aws_s3_bucket_object" "object" {
bucket = "your_bucket_name"
key = "new_object_key"
source = "path/to/file"
} | package terraform.validation
default has_aws_s3_bucket_object = false
has_aws_s3_bucket_object {
object := input.planned_values.root_module.resources[_]
# aws_s3_object replaces the deprecated aws_s3_bucket_object (removed in AWS provider v6)
{"aws_s3_bucket_object", "aws_s3_object"}[object.type]
obje... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_s3_bucket_object.object","mode":"managed","type":"aws_s3_bucket_object","name":"object","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"acl":"private","bucket":"your_buc... | I need to place a new file into our cloud storage in a way that keeps things simple and lets me control where it goes. It should live in us-west-1, and the file should be stored under the name new_object_key. Call the thing that holds it "object". The storage it goes into is named your_bucket_name, and the file to uplo... |
174 | I need a managed analytics datastore for our internal reporting, with some custom tuning applied and a way to get notified whenever those settings change so we can keep an eye on things. | Create an AWS Redshift cluster with example cluster parameters and notifications on events associated with the parameter group | Has one resource "aws_sns_topic"
Has one resource "aws_redshift_parameter_group"
Has one resource "aws_redshift_cluster"
with cluster_parameter_group_name = parameter group id
Has one resource "aws_redshift_event_subscription"
with source_type = "cluster-parameter-group"
and sns topic referenced in sns_topic_arn
and... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_redshift_cluster" "example" {
cluster_identifier = "tf-redshift-cluster"
database_name = "mydb"
mas... | package aws_redshift_cluster_parameter_event_subscription
import future.keywords.in
default valid := false
valid {
some topic in input.configuration.root_module.resources
topic.type == "aws_sns_topic"
some param_group in input.configuration.root_module.resources
param_group.type == "aws_redshift_parameter_group"... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_redshift_cluster.example","mode":"managed","type":"aws_redshift_cluster","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"allow_version_upgrade":true,"ap... | I need a managed analytics datastore for our internal reporting, running in us-east-1. Use ra3.xlplus hardware in a single-node setup, with the database named mydb, admin user exampleuser and password Mustbe8characters. Apply a custom tuning set called parameter-group-test-terraform that sets require_ssl to true, query... |
79 | I need a place to store files where the people downloading them, not us, should cover the access costs, and it should be simple to manage. | create a bucket 'pike-680235478471'. Set up request payment configuration for an AWS S3 bucket named 'pike-680235478471', specifying the payer as 'Requester'. | has one aws_s3_bucket resource
with bucket
has one aws_s3_bucket_request_payment_configuration resource
with bucket
with payer (BucketOwner or Requester) | provider "aws" {
region = "us-west-1"
}
resource "aws_s3_bucket" "a" {
bucket = "pike-680235478471"
}
resource "aws_s3_bucket_request_payment_configuration" "pike" {
bucket = "pike-680235478471"
payer = "Requester"
} | package terraform.validation
default has_s3_bucket = false
default has_s3_bucket_request_payment_configuration = false
default valid_configuration = false
has_s3_bucket {
some i
bucket := input.planned_values.root_module.resources[i]
bucket.type == "aws_s3_bucket"
bucket.values.bucket == "pike-68023... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_s3_bucket.a","mode":"managed","type":"aws_s3_bucket","name":"a","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"bucket":"pike-680235478471","force_destroy":false,"region... | I need a place to store files in us-west-1, named pike-680235478471, where the people downloading them, not us, cover the access costs. Label that cost setting "pike". It should be simple to manage. |
110 | I need a simple place to keep user-related data that can handle sudden spikes in activity without me having to plan capacity ahead of time. | Configure on-demand capacity mode for a DynamoDB table. | dynamodb table -> hash_key, name, attribute (name, type), billing mode pay per read | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_dynamodb_table" "basic-dynamodb-table" {
name = "example"
billing_mode = "PAY_PER_REQUEST"
hash_key = "UserId"
attribut... | package main
import future.keywords.in
default allow = false
# Check if the AWS DynamoDB table is being created in us-east-1
aws_dynamodb_table_valid(resources) {
some resource in resources
resource.type == "aws_dynamodb_table"
resource.change.after.billing_mode == "PAY_PER_REQUEST"
}
# Aggregate all ch... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_dynamodb_table.basic-dynamodb-table","mode":"managed","type":"aws_dynamodb_table","name":"basic-dynamodb-table","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"attribute... | I need a simple place to keep user-related data that can handle sudden spikes in activity without me having to plan capacity ahead of time. Put it in us-east-1. Call it "example", and each record should be identified by a UserId value stored as text. |
172 | I need a managed place to run large analytical queries, and I want to get alerted whenever something important happens there so we can react quickly. | Create an AWS Redshift cluster with notifications on events | Has one resource "aws_sns_topic"
Has one resource "aws_redshift_cluster"
Has one resource "aws_redshift_event_subscription"
with source_type = "cluster"
and sns topic referenced in sns_topic_arn
and cluster referenced in source_ids | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_redshift_cluster" "example" {
cluster_identifier = "default"
database_name = "default"
master_username = "exampleuser"
master_pass... | package aws_redshift_cluster_event_subscription
import future.keywords.in
default valid := false
valid {
some topic in input.configuration.root_module.resources
topic.type == "aws_sns_topic"
some cluster in input.configuration.root_module.resources
cluster.type == "aws_redshift_cl... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_redshift_cluster.example","mode":"managed","type":"aws_redshift_cluster","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"allow_version_upgrade":true,"ap... | I need a managed place to run large analytical queries in us-east-1, and I want to get alerted whenever something important happens there so we can react quickly. Set it up in our configuration under the name example. Name the compute environment and its main database "default", with admin login exampleuser and passwor... |
194 | I need a place to store files that my web app can interact with directly, and it should only accept requests coming from our main site. | Create a S3 bucket with a CORS configuration that allows POSTs and GETs from my website "https://domain.com". | Has an aws_s3_bucket
Has an aws_s3_bucket_cors_configuration
with bucket = bucket id OR name
with cors rule {
allowed_headers = ["*"]
allowed_methods = ["GET", "POST"]
allowed_origins = ["https://domain.com"]
} | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "example" {
bucket = "mybucket"
}
resource "aws_s3_bucket_cors_configuration" "example" {
bucket = aws_s3_bucket.example.id
cor... | package aws_s3_bucket_cors
import future.keywords.in
default valid := false
valid { # IF THE BUCKET IS REFERRED TO BY ID
some bucket in input.configuration.root_module.resources
bucket.type == "aws_s3_bucket"
some cors_config in input.configuration.root_module.resources
cors_config.type == "aws_s3_bu... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_s3_bucket.example","mode":"managed","type":"aws_s3_bucket","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"bucket":"mybucket","force_destroy":false,"reg... | I need a place to store files that my web app can interact with directly, and it should only accept requests coming from our main site at https://domain.com. Put it in us-east-1, call the setup "example", and name the storage itself "mybucket". |
49 | We need a way to funnel high‑volume app data into long‑term storage automatically, with something that can smooth out traffic spikes and keep things reliable without much manual work. | Generate a Kinesis Firehose Delivery Stream with an extended S3 Destination | Has one "aws_iam_role" resource, one "aws_s3_bucket" resource, and one "aws_kinesis_firehose_delivery_stream" resource with an "extended_s3_configuration" block
| provider "aws" {
region = "us-west-2"
}
resource "aws_s3_bucket" "januarysixteenth" {
bucket = "januarysixteenth"
}
data "aws_iam_policy_document" "firehose_assume_role" {
statement {
effect = "Allow"
principals {
type = "Service"
identifiers = ["firehose.amazonaws.com"]
}
a... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"firehose.amazonaws.com")
}
has_valid_bucket {
some i
re... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_iam_role.firehose_role","mode":"managed","type":"aws_iam_role","name":"firehose_role","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"assume_role_policy":"{\"Statement\"... | We need a way to funnel high-volume app data into long-term storage automatically, with something that can smooth out traffic spikes and keep things reliable without much manual work. Set it all up in us-west-2, and the long-term storage should be named januarysixteenth. |
183 | I need a simple place online where I can keep the pictures my site will show, ideally something reliable that won’t cost too much. | Create an AWS resource to help me store images that I want to display on my website | Has an aws_s3_bucket resource | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "example-bucket" {
bucket = "test-bucket"
} | package aws_s3
import future.keywords.in
default valid := false
valid {
some bucket in input.configuration.root_module.resources
bucket.type == "aws_s3_bucket"
} | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_s3_bucket.example-bucket","mode":"managed","type":"aws_s3_bucket","name":"example-bucket","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"bucket":"test-bucket","force_de... | I need a simple place online where I can keep the pictures my site will show, ideally something reliable that won't cost too much. Please set it up in us-east-1. |
176 | I need a couple of individual logins for our teammates and a simple way to manage them together so we can control their access consistently. | Create two basic AWS IAM users that are a part of a basic IAM group | Has one "aws_iam_group" resource
with one "name" with any value
Has one "aws_iam_user" resource
with one "name" with any value
Has another "aws_iam_user" resource
with one "name" with any value
Has one "aws_iam_group_membership" resource
with one "name" with any value
with one "users" with the two user resource name... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_iam_group_membership" "team" {
name = "tf-testing-group-membership"
users = [
aws_iam_user.user_one.name,
aws_iam_user.user_two.name,... | package iam_group_two_users
import future.keywords.in
default valid := false
valid {
some user1 in input.configuration.root_module.resources
user1.type == "aws_iam_user"
some user2 in input.configuration.root_module.resources
user2.type == "aws_iam_user"
not user1 == user2
some group in inp... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_iam_group.group","mode":"managed","type":"aws_iam_group","name":"group","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"name":"test-group","path":"/"},"sensitive_values"... | I need a couple of individual logins for our teammates and a simple way to manage them together so we can control their access consistently. Set this up in us-east-1. The two logins should be named test-user and test-user-two, and the thing that holds them together should be named test-group. In the setup itself, label... |
135 | I need a reliable place to store our app’s data that can handle a lot of traffic, stay available if part of the system goes down, and keep regular backups without much manual work. | Create an Aurora PostgresQL cluster | Has a aws_rds_cluster with engine=="aurora-postgresql" | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
# Configure the AWS Provider
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "vpc" {
cidr_block = "192.168.0.0/22"
}
resource "aws_rds_cluster" "default" {
cluster_identifier = "aurora-cluster-demo"
engine = "aurora... | package main
import future.keywords.in
default allow = false
# Check for Aurora MySQL RDS cluster creation
rds_cluster_created(resources) {
some resource in resources
resource.type == "aws_rds_cluster"
resource.change.actions[_] == "create"
}
# Check if the RDS cluster engine is Aurora MySQL
rds_cluster_engine_vali... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_rds_cluster.default","mode":"managed","type":"aws_rds_cluster","name":"default","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"allow_major_version_upgrade":null,"availa... | I need a reliable, PostgreSQL-compatible place to store our app's data that can handle a lot of traffic, stay available if part of the system goes down, and keep regular backups without much manual work. Put it in us-east-1, and use the private network range 192.168.0.0/22. Backups should run daily between 07:00-09:00 ... |
22 | I want an automated build setup that can pull in code from more than one place and run in a locked‑down environment, keeping things as simple as possible. | create a AWS codebuild project resource with example iam role and secondary sources | Has one "aws_iam_role" resource and one "aws_codebuild_project" resource with a "secondary_sources" block | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
data "aws_iam_policy_document" "assume_role" {
statement {
effect = "Allow"
principals {
type = "Serv... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
# Rule for aws_iam_role resource
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"codebuild.amazonaws.com")
}
h... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_codebuild_project.example7","mode":"managed","type":"aws_codebuild_project","name":"example7","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"artifacts":[{"artifact_iden... | I want an automated build setup in us-east-1 that can pull in code from more than one place and run in a locked-down environment, keeping things as simple as possible. The build should be named test-project7 (I refer to it internally as example7), and it should run under a permission identity called test_role7. The mai... |
235 | I need a small managed data store for an app prototype, and if we ever delete it I want to make sure we can keep a last backup without much hassle. | AWS Lightsail that creates a postgres database (blueprint "postgres_12"), which enable creating a final snapshot of your database on deletion | "have one ""aws_lightsail_database"" resource
with relational_database_name argument
with master_database_name
with master_password
with master_username
with blueprint_id = postgres_12
with bundle_id
with final_snapshot_name | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_lightsail_database" "test" {
relational_database_name = "test"
availability_zone = "us-east-1a"
master_database_name ... | package terraform.validation
default has_valid_lightsail_database = false
# Rule for aws_lightsail_database resource with specific arguments
has_valid_lightsail_database {
some i
resource := input.planned_values.root_module.resources[i]
resource.type == "aws_lightsail_database"
resource.values.relatio... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_lightsail_database.test","mode":"managed","type":"aws_lightsail_database","name":"test","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"availability_zone":"us-east-1a","... | I need a small managed data store for an app prototype, running in us-east-1 and placed in us-east-1a. Call it "test" and use "test" as the admin user name. It should use postgres_12 and the micro_1_0 size, with the internal data name "testdatabasename". If we ever delete it I want to make sure we can keep a last backu... |
274 | I need a shared place for my apps to keep files so they can all read and write to the same spot, and it should be reachable from inside our private network. | create a AWS EFS with mount target | Have one "aws_efs_file_system" resource
Have one "aws_efs_mount_target" resource
with one "file_system_id"
with one "subnet_id"
Have one "aws_subnet" resource
(FOR SUBNET_ID IN MOUNT_TARGET)
Have one "aws_vpc" resource
(FOR VPC_ID IN "AWS_SUBNET") | # Define the provider block for AWS
provider "aws" {
region = "us-east-2" # Set your desired AWS region
}
resource "aws_efs_file_system" "foo" {
creation_token = "my-product"
tags = {
Name = "MyProduct"
}
}
resource "aws_efs_mount_target" "alpha" {
file_system_id = aws_efs_file_system.foo.id
subnet_i... | package terraform.validation
default is_valid_efs_setup = false
# Rule to check if a valid aws_efs_file_system and aws_efs_file_system_policy exists
is_valid_efs_setup {
has_valid_efs_file_system
has_valid_aws_efs_mount_target
is_valid_vpc
is_valid_subnet
}
# Helper rule to check if a valid aws_efs_f... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_efs_file_system.foo","mode":"managed","type":"aws_efs_file_system","name":"foo","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"creation_token":"my-product","lifecycle_p... | I need a shared place for my apps to keep files so they can all read and write to the same spot, and it should be reachable from inside our private network. Put it all in us-east-2. The shared storage should be identified as "my-product" and named foo. Our private network should use the address range 10.0.0.0/16, with ... |
63 | I need a place to run containerized apps in a managed, scalable way, with its own network space and the right access setup, and I want my local tools to be able to talk to it securely and reliably. | Set up an AWS provider for the specified region. Retrieve the current caller identity using 'aws_caller_identity'. Optionally, fetch the latest stable ECR image tagged as 'stable' from the specified repository. Define local variables including an image tag, AWS tags, and workspace name. Create the EKS cluster with an a... | has one "aws_caller_identity" data source named "current"
has one "aws_ecr_image"
with one "repository_name"
with one "image_tag"
has multiple local variables defining:
"image_tag"
"aws_tags"
"workspace_name"
has one module named "eks"
has one "aws_eks_cluster" data source named "aptos"
with one "name"
with a "dep... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
variable "cluster_name" {
type = string
default = "test-cluster"
}
data "aws_region" "current" {}
resource "aws_vpc" "ma... | package terraform.validation
default has_aws_eks_cluster = false
default has_aws_iam_role = false
default has_aws_iam_role_policy_attachment_eks_cluster = false
default has_aws_iam_role_policy_attachment_eks_service = false
has_aws_eks_cluster {
some i
eks_cluster := input.configuration.root_module.resources[... | {"format_version":"1.2","terraform_version":"1.14.3","variables":{"cluster_name":{"value":"test-cluster"}},"planned_values":{"root_module":{"resources":[{"address":"aws_eks_cluster.example","mode":"managed","type":"aws_eks_cluster","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":... | I need a place to run containerized apps in a managed, scalable way in us-east-1. Give it its own network space called main using 10.0.0.0/16, with two address ranges inside it, 10.0.1.0/24 and 10.0.2.0/24, each in a different availability zone that's currently available. Set up the access permissions it needs and name... |
193 | I need a place to store files that a web app can interact with directly, and it should allow requests from different parts of the app while still keeping things reasonably controlled. | Create a S3 bucket and a bucket CORS configuration resource that attaches an example CORS rule to the bucket. Make sure the CORS rule has all of the required attributes. | Has an aws_s3_bucket
Has an aws_s3_bucket_cors_configuration | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "example" {
bucket = "mybucket"
}
resource "aws_s3_bucket_cors_configuration" "example" {
bucket = aws_s3_bucket.example.id
cor... | package aws_s3_bucket_cors
import future.keywords.in
default valid := false
valid { # IF THE BUCKET IS REFERRED TO BY ID
some bucket in input.configuration.root_module.resources
bucket.type == "aws_s3_bucket"
some cors_config in input.configuration.root_module.resources
cors_config.type == "aws_s3_bucket_c... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_s3_bucket.example","mode":"managed","type":"aws_s3_bucket","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"bucket":"mybucket","force_destroy":false,"reg... | I need a place to store files that a web app can interact with directly, and it should allow requests from different parts of the app while still keeping things reasonably controlled. Put it in us-east-1. Call it example, and the storage itself should be named mybucket. The cross-origin permissions should be cacheable ... |
40 | We need a way to stream our app’s event data into a search and analytics system in near‑real time, with a fallback location for anything that can’t be processed right away. | Generate a Kinesis Firehose Delivery Stream with a Elasticsearch destination with the appropriate iam role and bucket | Has one "aws_iam_role" resource, one "aws_s3_bucket" resource, one "aws_elasticsearch_domain" resource, and one "aws_kinesis_firehose_delivery_stream" resource with an "elasticsearch_configuration" block | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "januarythird" {
bucket = "januarythird"
}
resource "aws_elasticsearch_domain" "test_cluster" {
... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"firehose.amazonaws.com")
}
has_valid_bucket {
some i
resource ... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elasticsearch_domain.test_cluster","mode":"managed","type":"aws_elasticsearch_domain","name":"test_cluster","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"cluster_confi... | We need a way to stream our app's event data into a search and analytics system in near-real time, with a fallback location for anything that can't be processed right away. Everything should live in us-east-1. The search and analytics system should be named es-test-2, spread over 2 nodes, each with 10 GB of storage; in... |
282 | I need a private environment for our data systems that works across multiple fault zones, can reach the public internet when needed, and lets our database services accept connections openly while keeping the setup straightforward. | Set up a VPC in the AWS region with two subnets in different availability zones, an internet gateway, and a route table for internet access. It also defines a security group to allow access to MySQL and PostgreSQL databases on their default ports from any IP address and creates a database subnet group including both su... | Has one "aws_vpc" resource:
Includes a "cidr_block" for network configuration
Has two "aws_subnet" resources:
Both subnets are part of the "aws_vpc" resource
Each subnet is located in a different availability zone
Has one "aws_internet_gateway" resource:
Attached to the "aws_vpc" resource
Has one "aws_route_table" r... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
}
data "aws_availability_zo... | package terraform.validation
# Set default validation states
default is_valid_vpc = false
default is_valid_internet_gateway = false
default is_valid_route_table = false
default is_valid_subnets1 = false
default is_valid_subnets2 = false
default is_valid_security_group = false
default is_valid_db_subnet_group = f... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_db_subnet_group.default","mode":"managed","type":"aws_db_subnet_group","name":"default","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"description":"Managed by Terrafor... | I need a private environment for our data systems that works across multiple fault zones, can reach the public internet when needed, and lets our database services accept connections openly while keeping the setup straightforward. Put it in us-east-1. Use the private network range 10.0.0.0/16 with DNS hostnames turned ... |
150 | I need a private network for our systems that works with both older and newer addressing formats, and it should be flexible enough to grow over time. | Create an AWS VPC resource with an example CIDR block and IPv6 enabled | Has one resource "aws_vpc"
with one "cidr_block" with any valid IPv4 address
with one "assign_generated_ipv6_cidr_block" with value "true" | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
assign_generated_ipv6_cidr_block = true
}
| package vpc_ipv6
import future.keywords.in
default valid := false
valid {
some changed_resource in input.resource_changes
changed_resource.type == "aws_vpc"
"create" in changed_resource.change.actions
args := changed_resource.change.after
net.cidr_is_valid(args.cidr_block)
args.assign_generated_ipv6_cidr_block ... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_vpc.main","mode":"managed","type":"aws_vpc","name":"main","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"assign_generated_ipv6_cidr_block":true,"cidr_block":"10.0.0.0/1... | I need a private network for our systems in us-east-1, called main, using the address range 10.0.0.0/16. It should work with both older and newer addressing formats, and be flexible enough to grow over time. |
185 | I need a place to store files where our team clearly owns anything that gets added, and it should only be accessible to us while keeping things simple. | Create S3 bucket with bucket name = "mybucket" and set the ownership control of the S3 bucket to be bucket owner preferred.
Then create an ACL resource that depends on ownership control and makes bucket private. Use bucket references, NOT the name of the bucket. | Has an aws_s3_bucket resource
Has an aws_s3_bucket_ownership_controls
with bucket = bucket id
and rule with object_ownership = "BucketOwnerPreferred"
Has an aws_s3_bucket_acl | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "example" {
bucket = "mybucket"
}
resource "aws_s3_bucket_ownership_controls" "example" {
bucket = aws_s3_bucket.example.id
rule... | package s3_bucket_acl
import future.keywords.in
default valid := false
valid {
some bucket in input.configuration.root_module.resources
bucket.type == "aws_s3_bucket"
bucket.expressions.bucket.constant_value == "mybucket"
some ownership_controls in input.configuration.root_module.resources
ow... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_s3_bucket.example","mode":"managed","type":"aws_s3_bucket","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"bucket":"mybucket","force_destroy":false,"reg... | I need a place to store files where our team clearly owns anything that gets added, and it should only be accessible to us while keeping things simple. Put it in us-east-1. Call it "example" in our setup, and the actual storage name should be "mybucket". Access should be private. |
295 | I need two separate private networks to be able to talk to each other directly so systems in each one can work together without going over the public internet. | establishes a VPC peering connection between two AWS Virtual Private Clouds (VPCs). The first VPC, named "peer," is configured with a CIDR block of 10.0.0.0/24, and the second VPC, named "base," has a CIDR block of 10.1.0.0/24. The peering connection, named "pike," connects these two VPCs, allowing them to communicate ... | Has two "aws_vpc" resources:
The first VPC is named "peer" and is configured with a "cidr_block" of "10.0.0.0/24".
The second VPC is named "base" and is configured with a "cidr_block" of "10.1.0.0/24".
Has one "aws_vpc_peering_connection" resource:
Named "pike" to connect the two specified VPCs ("peer" and "base").
Co... | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.16"
}
}
required_version = ">= 1.2.0"
}
# Define the provider block for AWS
provider "aws" {
region = "us-east-2" # Set your desired AWS region
}
resource "aws_vpc_peering_connection" "pike" {
peer_vpc_id ... | package terraform.validation
# Set default validation states
default is_valid_vpcs = false
default is_valid_vpc_peering_connection = false
# Validate aws_vpc resources
is_valid_vpcs {
# Validate the first VPC named "peer"
peer_vpc := input.configuration.root_module.resources[_]
peer_vpc.type == "aws_vpc"
... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_vpc.base","mode":"managed","type":"aws_vpc","name":"base","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"assign_generated_ipv6_cidr_block":null,"cidr_block":"10.1.0.0/2... | I need two separate private networks to be able to talk to each other directly so systems in each one can work together without going over the public internet. Put everything in us-east-2. One network should be named peer and use the address range 10.0.0.0/24, and the other should be named base and use 10.1.0.0/24. Nam... |
98 | I need a shared analytics workspace that can handle moderate workloads across multiple machines, and it should allow certain external systems to plug into it securely. | Create a 2-node RedShift cluster and attach a resource policy to it. | Create a redshift cluster and a aws_reedshift_resource_poliicy attached to it | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_redshift_cluster" "example" {
cluster_identifier = "redshift-cluster-1"
node_type = "dc2.large"
cluster_type = "multi-node"
... | package main
import future.keywords.in
default allow = false
aws_redshift_cluster_valid(resources) {
some resource in resources
resource.type == "aws_redshift_cluster"
resource.change.after.number_of_nodes == 2
}
aws_redshift_resource_policy_valid(resources) {
some resource in resources
resource... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_redshift_cluster.example","mode":"managed","type":"aws_redshift_cluster","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"allow_version_upgrade":true,"ap... | I need a shared analytics workspace in us-east-1 that can handle moderate workloads across multiple machines, and it should allow certain external systems to plug into it securely. Set it up as multi-node with 2 machines of size dc2.large. Name the workspace setup "example". The admin login should be "foo" with passwor... |
35 | I need a simple way to take in continuous chunks of data so other parts of the system can process them reliably, and it should work even if the volume fluctuates a bit. | Generate a basic Amazon Kinesis stream | Has one "aws_kinesis_stream" resource | provider "aws" {
region = "us-west-2"
}
resource "aws_kinesis_stream" "test_stream" {
name = "drow1"
shard_count = 1
retention_period = 48
shard_level_metrics = [
"IncomingBytes",
"OutgoingBytes",
]
stream_mode_details {
stream_mode = "PROVISIONED"
}
tags = {
Envir... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_kinesis_stream {
resource := input.planned_values.root_module.resources[i]
resource.type == "aws_kinesis_stream"
resource.values.name
}
has_valid_resources {
has_valid_kinesis_stream
} | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_kinesis_stream.test_stream","mode":"managed","type":"aws_kinesis_stream","name":"test_stream","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"encryption_type":"NONE","en... | I need a simple way to take in continuous chunks of data so other parts of the system can process them reliably, and it should work even if the volume fluctuates a bit. Set it up in us-west-2 and call it drow1. One unit of throughput capacity is enough, and incoming data should stay available for 48 hours before it age... |
23 | I need an automated build setup that can pull in more than one codebase and produce multiple outputs, all while keeping things organized and secure. | create a AWS codebuild project resource with example iam role and secondary artifiacts | Has one "aws_iam_role" resource, at least one "aws_s3_bucket" resource, and one "aws_codebuild_project" resource with a "secondary_artifacts" block | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.75"
}
}
required_version = ">= 1.9.0"
}
provider "aws" {
region = "us-east-1"
}
resource "aws_iam_role" "test_role8" {
name = "test_role8"
assume_role_policy = jsonencode({
Version = "2012-10-17"
... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
# Rule for aws_iam_role resource
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"codebuild.amazonaws.com")
}
h... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_codebuild_project.example7","mode":"managed","type":"aws_codebuild_project","name":"example7","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"artifacts":[{"artifact_iden... | I need an automated build setup in us-east-1 that can pull in more than one codebase and produce multiple outputs, all while keeping things organized and secure.
Name the build setup test-project8 (I'll refer to it as example7 in my config). It should run under a permission role called test_role8.
Both codebases come... |
116 | I need a way for one of our in‑memory data access identities to sign in using our existing account‑level permissions system, so everything stays consistent and secure. | authenticate a elasticache user with iam | requires access string, engine = REDIS, user id and user name, authentication_mode {type = "iam"} | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_elasticache_user" "test" {
user_id = "testUserId"
user_name = "testUserName"
access_string = "on ~* +@all"
engine = "REDI... | package main
import future.keywords.in
default allow = false
aws_elasticache_user_valid(resources) {
some resource in resources
resource.type == "aws_elasticache_user"
resource.change.after.authentication_mode[_].type == "iam"
}
# Aggregate all checks
allow {
aws_elasticache_user_valid(input.resourc... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_elasticache_user.test","mode":"managed","type":"aws_elasticache_user","name":"test","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"access_string":"on ~* +@all","authent... | I need a way for one of our in-memory data access identities to sign in using our existing account-level permissions system, so everything stays consistent and secure. Set it up in us-east-1. The identity should be called testUserId with the login name testUserName, and its permissions should be "on ~* +@all". Name the... |
148 | I need a place to store structured app data that protects everything at rest without me having to manage any of the encryption myself. | Configure a DynamoDB table with server-side encryption enabled. | Has one "aws_dynamodb_table" resource
with one "server_side_encryption"
with one "enabled" = true | terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_dynamodb_table" "example" {
name = "your-dynamodb-table-name"
billing_mode = "PAY_PER_REQUEST" # Or "PROVISIONED" if you prefer provisioned capaci... | package main
import future.keywords.in
default allow = false
dynamodb_table_modified(resources) {
some resource in resources
resource.type == "aws_dynamodb_table"
resource.change.actions[_] == "create"
}
encryption_at_rest_enabled(resource) {
resource.type == "aws_dynamodb_table"
resource.change.after.server_side_e... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_dynamodb_table.example","mode":"managed","type":"aws_dynamodb_table","name":"example","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":1,"values":{"attribute":[{"name":"id","type":"S"... | I need a place to store structured app data that protects everything at rest without me having to manage any of the encryption myself. Put it in us-east-1 and call it "example". Records should be looked up by a field called "id" that holds text. |
51 | I need a small setup that can run some ongoing data queries for me, without requiring much maintenance and able to scale as needed. | Generate a basic Amazon Kinesis V2 Analytics Application to manage a SQL application | Has one "aws_iam_role" resource, and one "aws_kinesisanalyticsv2_application" with argument runtime_environment == "SQL-1_0" | provider "aws" {
region = "us-west-2"
}
data "aws_iam_policy_document" "KinesisAssume" {
statement {
effect = "Allow"
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["kinesisanalytics.amazonaws.com"]
}
}
}
resource "aws_iam_role" "kinesis_role" {
... | package terraform.validation
import future.keywords.in
default has_valid_resources = false
has_valid_iam_role(resources) {
some resource in resources
resource.type == "aws_iam_role"
contains(resource.change.after.assume_role_policy,"kinesisanalytics.amazonaws.com")
}
has_valid_kinesisanalyticsv2_appli... | {"format_version":"1.2","terraform_version":"1.14.3","planned_values":{"root_module":{"resources":[{"address":"aws_iam_role.kinesis_role","mode":"managed","type":"aws_iam_role","name":"kinesis_role","provider_name":"registry.terraform.io/hashicorp/aws","schema_version":0,"values":{"assume_role_policy":"{\"Statement\":[... | I need a small setup that can run some ongoing data queries for me, without requiring much maintenance and able to scale as needed. Put it in us-west-2. The query job should be named example-application1 and run on SQL-1_0. In my code I'd like to refer to it as flink_app. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.