AnimeshShaw commited on
Commit
3cec7bd
·
1 Parent(s): c304510

Add generated/simple/gpt-4o/

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. generated/simple/gpt-4o/aws-cfn-001/main.yaml +13 -0
  2. generated/simple/gpt-4o/aws-cfn-002/main.yaml +24 -0
  3. generated/simple/gpt-4o/aws-cfn-003/main.yaml +30 -0
  4. generated/simple/gpt-4o/aws-cfn-004/main.yaml +75 -0
  5. generated/simple/gpt-4o/aws-cfn-005/main.yaml +14 -0
  6. generated/simple/gpt-4o/aws-cfn-006/main.yaml +27 -0
  7. generated/simple/gpt-4o/aws-cfn-007/main.yaml +39 -0
  8. generated/simple/gpt-4o/aws-cfn-008/main.yaml +12 -0
  9. generated/simple/gpt-4o/aws-cfn-009/main.yaml +63 -0
  10. generated/simple/gpt-4o/aws-cfn-010/main.yaml +31 -0
  11. generated/simple/gpt-4o/aws-tf-001/main.tf +29 -0
  12. generated/simple/gpt-4o/aws-tf-002/main.tf +17 -0
  13. generated/simple/gpt-4o/aws-tf-003/main.tf +35 -0
  14. generated/simple/gpt-4o/aws-tf-004/main.tf +108 -0
  15. generated/simple/gpt-4o/aws-tf-005/main.tf +37 -0
  16. generated/simple/gpt-4o/aws-tf-006/main.tf +47 -0
  17. generated/simple/gpt-4o/aws-tf-007/main.tf +25 -0
  18. generated/simple/gpt-4o/aws-tf-008/main.tf +88 -0
  19. generated/simple/gpt-4o/aws-tf-009/main.tf +26 -0
  20. generated/simple/gpt-4o/aws-tf-010/main.tf +52 -0
  21. generated/simple/gpt-4o/az-arm-001/main.json +42 -0
  22. generated/simple/gpt-4o/az-arm-002/main.json +141 -0
  23. generated/simple/gpt-4o/az-arm-003/main.json +74 -0
  24. generated/simple/gpt-4o/az-arm-004/main.json +27 -0
  25. generated/simple/gpt-4o/az-arm-005/main.json +32 -0
  26. generated/simple/gpt-4o/az-arm-006/main.json +34 -0
  27. generated/simple/gpt-4o/az-arm-007/main.json +20 -0
  28. generated/simple/gpt-4o/az-arm-008/main.json +22 -0
  29. generated/simple/gpt-4o/az-arm-009/main.json +45 -0
  30. generated/simple/gpt-4o/az-arm-010/main.json +78 -0
  31. generated/simple/gpt-4o/az-tf-001/main.tf +17 -0
  32. generated/simple/gpt-4o/az-tf-002/main.tf +91 -0
  33. generated/simple/gpt-4o/az-tf-003/main.tf +33 -0
  34. generated/simple/gpt-4o/az-tf-004/main.tf +22 -0
  35. generated/simple/gpt-4o/az-tf-005/main.tf +29 -0
  36. generated/simple/gpt-4o/az-tf-006/main.tf +51 -0
  37. generated/simple/gpt-4o/az-tf-007/main.tf +21 -0
  38. generated/simple/gpt-4o/az-tf-008/main.tf +25 -0
  39. generated/simple/gpt-4o/az-tf-009/main.tf +26 -0
  40. generated/simple/gpt-4o/az-tf-010/main.tf +16 -0
  41. generated/simple/gpt-4o/gcp-tf-001/main.tf +15 -0
  42. generated/simple/gpt-4o/gcp-tf-002/main.tf +49 -0
  43. generated/simple/gpt-4o/gcp-tf-003/main.tf +33 -0
  44. generated/simple/gpt-4o/gcp-tf-004/main.tf +9 -0
  45. generated/simple/gpt-4o/gcp-tf-005/main.tf +17 -0
  46. generated/simple/gpt-4o/gcp-tf-006/main.tf +45 -0
  47. generated/simple/gpt-4o/gcp-tf-007/main.tf +14 -0
  48. generated/simple/gpt-4o/gcp-tf-008/main.tf +14 -0
  49. generated/simple/gpt-4o/gcp-tf-009/main.tf +16 -0
  50. generated/simple/gpt-4o/gcp-tf-010/main.tf +29 -0
generated/simple/gpt-4o/aws-cfn-001/main.yaml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Resources:
3
+ StaticAssetsBucket:
4
+ Type: 'AWS::S3::Bucket'
5
+ Properties:
6
+ AccessControl: PublicRead
7
+ WebsiteConfiguration:
8
+ IndexDocument: index.html
9
+ DeletionPolicy: Retain
10
+ Outputs:
11
+ BucketName:
12
+ Description: Name of the S3 bucket
13
+ Value: !Ref StaticAssetsBucket
generated/simple/gpt-4o/aws-cfn-002/main.yaml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Resources:
3
+ MyEC2Instance:
4
+ Type: 'AWS::EC2::Instance'
5
+ Properties:
6
+ InstanceType: t2.micro
7
+ ImageId: ami-0c55b159cbfafe1f0 # Example AMI ID, replace with a valid one for your region
8
+ SecurityGroupIds:
9
+ - !Ref MySecurityGroup
10
+ KeyName: my-key-pair # Replace with your key pair name
11
+
12
+ MySecurityGroup:
13
+ Type: 'AWS::EC2::SecurityGroup'
14
+ Properties:
15
+ GroupDescription: Allow SSH and HTTP access
16
+ SecurityGroupIngress:
17
+ - IpProtocol: tcp
18
+ FromPort: 22
19
+ ToPort: 22
20
+ CidrIp: 0.0.0.0/0
21
+ - IpProtocol: tcp
22
+ FromPort: 80
23
+ ToPort: 80
24
+ CidrIp: 0.0.0.0/0
generated/simple/gpt-4o/aws-cfn-003/main.yaml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: AWS CloudFormation Template to deploy an RDS MySQL database without encryption at rest.
3
+
4
+ Resources:
5
+ MyDBInstance:
6
+ Type: 'AWS::RDS::DBInstance'
7
+ Properties:
8
+ DBInstanceIdentifier: mydbinstance
9
+ AllocatedStorage: '20'
10
+ DBInstanceClass: db.t3.micro
11
+ Engine: MySQL
12
+ EngineVersion: '8.0'
13
+ MasterUsername: admin
14
+ MasterUserPassword: password123
15
+ BackupRetentionPeriod: 7
16
+ MultiAZ: false
17
+ PubliclyAccessible: true
18
+ StorageType: gp2
19
+ VPCSecurityGroups:
20
+ - !GetAtt MyDBSecurityGroup.GroupId
21
+
22
+ MyDBSecurityGroup:
23
+ Type: 'AWS::EC2::SecurityGroup'
24
+ Properties:
25
+ GroupDescription: Enable access to RDS MySQL
26
+ SecurityGroupIngress:
27
+ - IpProtocol: tcp
28
+ FromPort: '3306'
29
+ ToPort: '3306'
30
+ CidrIp: 0.0.0.0/0
generated/simple/gpt-4o/aws-cfn-004/main.yaml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: AWS CloudFormation Template to create a VPC with public subnets only.
3
+
4
+ Resources:
5
+ VPC:
6
+ Type: AWS::EC2::VPC
7
+ Properties:
8
+ CidrBlock: 10.0.0.0/16
9
+ EnableDnsSupport: true
10
+ EnableDnsHostnames: true
11
+ Tags:
12
+ - Key: Name
13
+ Value: PublicVPC
14
+
15
+ InternetGateway:
16
+ Type: AWS::EC2::InternetGateway
17
+ Properties:
18
+ Tags:
19
+ - Key: Name
20
+ Value: PublicVPC-IGW
21
+
22
+ AttachGateway:
23
+ Type: AWS::EC2::VPCGatewayAttachment
24
+ Properties:
25
+ VpcId: !Ref VPC
26
+ InternetGatewayId: !Ref InternetGateway
27
+
28
+ PublicSubnet1:
29
+ Type: AWS::EC2::Subnet
30
+ Properties:
31
+ VpcId: !Ref VPC
32
+ CidrBlock: 10.0.1.0/24
33
+ MapPublicIpOnLaunch: true
34
+ AvailabilityZone: !Select [ 0, !GetAZs '' ]
35
+ Tags:
36
+ - Key: Name
37
+ Value: PublicSubnet1
38
+
39
+ PublicSubnet2:
40
+ Type: AWS::EC2::Subnet
41
+ Properties:
42
+ VpcId: !Ref VPC
43
+ CidrBlock: 10.0.2.0/24
44
+ MapPublicIpOnLaunch: true
45
+ AvailabilityZone: !Select [ 1, !GetAZs '' ]
46
+ Tags:
47
+ - Key: Name
48
+ Value: PublicSubnet2
49
+
50
+ PublicRouteTable:
51
+ Type: AWS::EC2::RouteTable
52
+ Properties:
53
+ VpcId: !Ref VPC
54
+ Tags:
55
+ - Key: Name
56
+ Value: PublicRouteTable
57
+
58
+ PublicRoute:
59
+ Type: AWS::EC2::Route
60
+ Properties:
61
+ RouteTableId: !Ref PublicRouteTable
62
+ DestinationCidrBlock: 0.0.0.0/0
63
+ GatewayId: !Ref InternetGateway
64
+
65
+ SubnetRouteTableAssociation1:
66
+ Type: AWS::EC2::SubnetRouteTableAssociation
67
+ Properties:
68
+ SubnetId: !Ref PublicSubnet1
69
+ RouteTableId: !Ref PublicRouteTable
70
+
71
+ SubnetRouteTableAssociation2:
72
+ Type: AWS::EC2::SubnetRouteTableAssociation
73
+ Properties:
74
+ SubnetId: !Ref PublicSubnet2
75
+ RouteTableId: !Ref PublicRouteTable
generated/simple/gpt-4o/aws-cfn-005/main.yaml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Resources:
3
+ IAMUser:
4
+ Type: 'AWS::IAM::User'
5
+ Properties:
6
+ UserName: 'FullAccessUser'
7
+ Policies:
8
+ - PolicyName: 'FullAccessPolicy'
9
+ PolicyDocument:
10
+ Version: '2012-10-17'
11
+ Statement:
12
+ - Effect: 'Allow'
13
+ Action: '*'
14
+ Resource: '*'
generated/simple/gpt-4o/aws-cfn-006/main.yaml ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Resources:
3
+ MyCloudFrontDistribution:
4
+ Type: 'AWS::CloudFront::Distribution'
5
+ Properties:
6
+ DistributionConfig:
7
+ Enabled: true
8
+ Origins:
9
+ - Id: myS3Origin
10
+ DomainName: mybucket.s3.amazonaws.com
11
+ S3OriginConfig:
12
+ OriginAccessIdentity: ''
13
+ DefaultCacheBehavior:
14
+ TargetOriginId: myS3Origin
15
+ ViewerProtocolPolicy: 'redirect-to-https'
16
+ AllowedMethods:
17
+ - GET
18
+ - HEAD
19
+ CachedMethods:
20
+ - GET
21
+ - HEAD
22
+ ForwardedValues:
23
+ QueryString: false
24
+ Cookies:
25
+ Forward: 'none'
26
+ ViewerCertificate:
27
+ CloudFrontDefaultCertificate: true
generated/simple/gpt-4o/aws-cfn-007/main.yaml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Description: AWS CloudFormation Template to create an ElastiCache Redis Cluster exposed to the internet
3
+
4
+ Resources:
5
+ RedisSubnetGroup:
6
+ Type: AWS::ElastiCache::SubnetGroup
7
+ Properties:
8
+ Description: "Subnet group for Redis cluster"
9
+ SubnetIds:
10
+ - subnet-abc12345
11
+ - subnet-def67890
12
+
13
+ RedisSecurityGroup:
14
+ Type: AWS::EC2::SecurityGroup
15
+ Properties:
16
+ GroupDescription: Enable inbound access to Redis
17
+ VpcId: vpc-0123456789abcdef0
18
+ SecurityGroupIngress:
19
+ - IpProtocol: tcp
20
+ FromPort: 6379
21
+ ToPort: 6379
22
+ CidrIp: 0.0.0.0/0
23
+
24
+ RedisCluster:
25
+ Type: AWS::ElastiCache::CacheCluster
26
+ Properties:
27
+ CacheNodeType: cache.t3.micro
28
+ Engine: redis
29
+ NumCacheNodes: 1
30
+ VpcSecurityGroupIds:
31
+ - !Ref RedisSecurityGroup
32
+ CacheSubnetGroupName: !Ref RedisSubnetGroup
33
+ EngineVersion: 6.x
34
+ AutoMinorVersionUpgrade: true
35
+
36
+ Outputs:
37
+ RedisEndpoint:
38
+ Description: "Redis Endpoint"
39
+ Value: !GetAtt RedisCluster.RedisEndpoint.Address
generated/simple/gpt-4o/aws-cfn-008/main.yaml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Resources:
2
+ SNSTopic:
3
+ Type: AWS::SNS::Topic
4
+ Properties:
5
+ TopicName: MySNSTopic
6
+ Policy:
7
+ Version: '2012-10-17'
8
+ Statement:
9
+ - Effect: Allow
10
+ Principal: "*"
11
+ Action: "sns:Publish"
12
+ Resource: !Ref SNSTopic
generated/simple/gpt-4o/aws-cfn-009/main.yaml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Resources:
3
+ ECSCluster:
4
+ Type: AWS::ECS::Cluster
5
+ Properties: {}
6
+
7
+ TaskExecutionRole:
8
+ Type: AWS::IAM::Role
9
+ Properties:
10
+ AssumeRolePolicyDocument:
11
+ Version: '2012-10-17'
12
+ Statement:
13
+ - Effect: Allow
14
+ Principal:
15
+ Service:
16
+ - ecs-tasks.amazonaws.com
17
+ Action:
18
+ - sts:AssumeRole
19
+ Policies:
20
+ - PolicyName: ECSFargateTaskExecutionPolicy
21
+ PolicyDocument:
22
+ Version: '2012-10-17'
23
+ Statement:
24
+ - Effect: Allow
25
+ Action:
26
+ - ecr:GetDownloadUrlForLayer
27
+ - ecr:BatchGetImage
28
+ - ecr:BatchCheckLayerAvailability
29
+ - logs:CreateLogStream
30
+ - logs:PutLogEvents
31
+ Resource: '*'
32
+
33
+ TaskDefinition:
34
+ Type: AWS::ECS::TaskDefinition
35
+ Properties:
36
+ Family: web-app-task
37
+ Cpu: '256'
38
+ Memory: '512'
39
+ NetworkMode: awsvpc
40
+ RequiresCompatibilities:
41
+ - FARGATE
42
+ ExecutionRoleArn: !GetAtt TaskExecutionRole.Arn
43
+ ContainerDefinitions:
44
+ - Name: web-app
45
+ Image: amazon/amazon-ecs-sample
46
+ Essential: true
47
+ PortMappings:
48
+ - ContainerPort: 80
49
+
50
+ ECSService:
51
+ Type: AWS::ECS::Service
52
+ Properties:
53
+ Cluster: !Ref ECSCluster
54
+ DesiredCount: 1
55
+ LaunchType: FARGATE
56
+ TaskDefinition: !Ref TaskDefinition
57
+ NetworkConfiguration:
58
+ AwsvpcConfiguration:
59
+ AssignPublicIp: ENABLED
60
+ Subnets:
61
+ - subnet-12345678 # Replace with your subnet ID
62
+ SecurityGroups:
63
+ - sg-12345678 # Replace with your security group ID
generated/simple/gpt-4o/aws-cfn-010/main.yaml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AWSTemplateFormatVersion: '2010-09-09'
2
+ Resources:
3
+ ApiGatewayRestApi:
4
+ Type: AWS::ApiGateway::RestApi
5
+ Properties:
6
+ Name: MyApiGateway
7
+
8
+ ApiGatewayResource:
9
+ Type: AWS::ApiGateway::Resource
10
+ Properties:
11
+ ParentId: !GetAtt ApiGatewayRestApi.RootResourceId
12
+ PathPart: myresource
13
+ RestApiId: !Ref ApiGatewayRestApi
14
+
15
+ ApiGatewayMethod:
16
+ Type: AWS::ApiGateway::Method
17
+ Properties:
18
+ AuthorizationType: NONE
19
+ HttpMethod: GET
20
+ ResourceId: !Ref ApiGatewayResource
21
+ RestApiId: !Ref ApiGatewayRestApi
22
+ Integration:
23
+ IntegrationHttpMethod: GET
24
+ Type: MOCK
25
+
26
+ ApiGatewayDeployment:
27
+ Type: AWS::ApiGateway::Deployment
28
+ Properties:
29
+ RestApiId: !Ref ApiGatewayRestApi
30
+ StageName: prod
31
+ DependsOn: ApiGatewayMethod
generated/simple/gpt-4o/aws-tf-001/main.tf ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_s3_bucket" "website_bucket" {
6
+ bucket = "my-unique-website-bucket-name"
7
+ acl = "public-read"
8
+
9
+ website {
10
+ index_document = "index.html"
11
+ error_document = "error.html"
12
+ }
13
+ }
14
+
15
+ resource "aws_s3_bucket_policy" "website_bucket_policy" {
16
+ bucket = aws_s3_bucket.website_bucket.id
17
+
18
+ policy = jsonencode({
19
+ Version = "2012-10-17"
20
+ Statement = [
21
+ {
22
+ Effect = "Allow"
23
+ Principal = "*"
24
+ Action = "s3:GetObject"
25
+ Resource = "${aws_s3_bucket.website_bucket.arn}/*"
26
+ }
27
+ ]
28
+ })
29
+ }
generated/simple/gpt-4o/aws-tf-002/main.tf ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_s3_bucket" "backup_bucket" {
6
+ bucket = "my-backup-bucket"
7
+ acl = "private"
8
+
9
+ versioning {
10
+ enabled = true
11
+ }
12
+
13
+ tags = {
14
+ Name = "BackupBucket"
15
+ Environment = "Production"
16
+ }
17
+ }
generated/simple/gpt-4o/aws-tf-003/main.tf ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_instance" "example" {
6
+ ami = "ami-0c55b159cbfafe1f0" # Amazon Linux 2 AMI
7
+ instance_type = "t2.micro"
8
+
9
+ associate_public_ip_address = true
10
+
11
+ vpc_security_group_ids = [aws_security_group.instance_sg.id]
12
+
13
+ tags = {
14
+ Name = "ExampleInstance"
15
+ }
16
+ }
17
+
18
+ resource "aws_security_group" "instance_sg" {
19
+ name = "instance_sg"
20
+ description = "Allow SSH inbound traffic"
21
+
22
+ ingress {
23
+ from_port = 22
24
+ to_port = 22
25
+ protocol = "tcp"
26
+ cidr_blocks = ["0.0.0.0/0"]
27
+ }
28
+
29
+ egress {
30
+ from_port = 0
31
+ to_port = 0
32
+ protocol = "-1"
33
+ cidr_blocks = ["0.0.0.0/0"]
34
+ }
35
+ }
generated/simple/gpt-4o/aws-tf-004/main.tf ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-west-2"
3
+ }
4
+
5
+ resource "aws_vpc" "main" {
6
+ cidr_block = "10.0.0.0/16"
7
+ }
8
+
9
+ resource "aws_subnet" "subnet_a" {
10
+ vpc_id = aws_vpc.main.id
11
+ cidr_block = "10.0.1.0/24"
12
+ availability_zone = "us-west-2a"
13
+ }
14
+
15
+ resource "aws_subnet" "subnet_b" {
16
+ vpc_id = aws_vpc.main.id
17
+ cidr_block = "10.0.2.0/24"
18
+ availability_zone = "us-west-2b"
19
+ }
20
+
21
+ resource "aws_security_group" "alb_sg" {
22
+ vpc_id = aws_vpc.main.id
23
+
24
+ ingress {
25
+ from_port = 80
26
+ to_port = 80
27
+ protocol = "tcp"
28
+ cidr_blocks = ["0.0.0.0/0"]
29
+ }
30
+
31
+ egress {
32
+ from_port = 0
33
+ to_port = 0
34
+ protocol = "-1"
35
+ cidr_blocks = ["0.0.0.0/0"]
36
+ }
37
+ }
38
+
39
+ resource "aws_security_group" "instance_sg" {
40
+ vpc_id = aws_vpc.main.id
41
+
42
+ ingress {
43
+ from_port = 80
44
+ to_port = 80
45
+ protocol = "tcp"
46
+ security_groups = [aws_security_group.alb_sg.id]
47
+ }
48
+
49
+ egress {
50
+ from_port = 0
51
+ to_port = 0
52
+ protocol = "-1"
53
+ cidr_blocks = ["0.0.0.0/0"]
54
+ }
55
+ }
56
+
57
+ resource "aws_lb" "app_lb" {
58
+ name = "app-lb"
59
+ internal = false
60
+ load_balancer_type = "application"
61
+ security_groups = [aws_security_group.alb_sg.id]
62
+ subnets = [aws_subnet.subnet_a.id, aws_subnet.subnet_b.id]
63
+ }
64
+
65
+ resource "aws_lb_target_group" "app_tg" {
66
+ name = "app-tg"
67
+ port = 80
68
+ protocol = "HTTP"
69
+ vpc_id = aws_vpc.main.id
70
+ }
71
+
72
+ resource "aws_lb_listener" "http" {
73
+ load_balancer_arn = aws_lb.app_lb.arn
74
+ port = 80
75
+ protocol = "HTTP"
76
+
77
+ default_action {
78
+ type = "forward"
79
+ target_group_arn = aws_lb_target_group.app_tg.arn
80
+ }
81
+ }
82
+
83
+ resource "aws_launch_configuration" "app_lc" {
84
+ name = "app-lc"
85
+ image_id = "ami-0c55b159cbfafe1f0" # Example AMI ID
86
+ instance_type = "t2.micro"
87
+ security_groups = [aws_security_group.instance_sg.id]
88
+
89
+ lifecycle {
90
+ create_before_destroy = true
91
+ }
92
+ }
93
+
94
+ resource "aws_autoscaling_group" "app_asg" {
95
+ launch_configuration = aws_launch_configuration.app_lc.id
96
+ min_size = 1
97
+ max_size = 3
98
+ desired_capacity = 2
99
+ vpc_zone_identifier = [aws_subnet.subnet_a.id, aws_subnet.subnet_b.id]
100
+
101
+ target_group_arns = [aws_lb_target_group.app_tg.arn]
102
+
103
+ tag {
104
+ key = "Name"
105
+ value = "app-instance"
106
+ propagate_at_launch = true
107
+ }
108
+ }
generated/simple/gpt-4o/aws-tf-005/main.tf ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-west-2"
3
+ }
4
+
5
+ resource "aws_db_instance" "postgresql" {
6
+ allocated_storage = 20
7
+ storage_type = "gp2"
8
+ engine = "postgres"
9
+ engine_version = "13.4"
10
+ instance_class = "db.t3.micro"
11
+ name = "mydatabase"
12
+ username = "admin"
13
+ password = "yourpassword"
14
+ parameter_group_name = "default.postgres13"
15
+ skip_final_snapshot = true
16
+
17
+ vpc_security_group_ids = [aws_security_group.rds_sg.id]
18
+ }
19
+
20
+ resource "aws_security_group" "rds_sg" {
21
+ name = "rds_sg"
22
+ description = "Allow access to RDS"
23
+
24
+ ingress {
25
+ from_port = 5432
26
+ to_port = 5432
27
+ protocol = "tcp"
28
+ cidr_blocks = ["0.0.0.0/0"]
29
+ }
30
+
31
+ egress {
32
+ from_port = 0
33
+ to_port = 0
34
+ protocol = "-1"
35
+ cidr_blocks = ["0.0.0.0/0"]
36
+ }
37
+ }
generated/simple/gpt-4o/aws-tf-006/main.tf ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_vpc" "main" {
6
+ cidr_block = "10.0.0.0/16"
7
+ }
8
+
9
+ resource "aws_subnet" "public" {
10
+ vpc_id = aws_vpc.main.id
11
+ cidr_block = "10.0.1.0/24"
12
+ map_public_ip_on_launch = true
13
+ availability_zone = "us-east-1a"
14
+ }
15
+
16
+ resource "aws_subnet" "private" {
17
+ vpc_id = aws_vpc.main.id
18
+ cidr_block = "10.0.2.0/24"
19
+ availability_zone = "us-east-1a"
20
+ }
21
+
22
+ resource "aws_internet_gateway" "igw" {
23
+ vpc_id = aws_vpc.main.id
24
+ }
25
+
26
+ resource "aws_route_table" "public" {
27
+ vpc_id = aws_vpc.main.id
28
+
29
+ route {
30
+ cidr_block = "0.0.0.0/0"
31
+ gateway_id = aws_internet_gateway.igw.id
32
+ }
33
+ }
34
+
35
+ resource "aws_route_table_association" "public" {
36
+ subnet_id = aws_subnet.public.id
37
+ route_table_id = aws_route_table.public.id
38
+ }
39
+
40
+ resource "aws_route_table" "private" {
41
+ vpc_id = aws_vpc.main.id
42
+ }
43
+
44
+ resource "aws_route_table_association" "private" {
45
+ subnet_id = aws_subnet.private.id
46
+ route_table_id = aws_route_table.private.id
47
+ }
generated/simple/gpt-4o/aws-tf-007/main.tf ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_iam_role" "admin_role" {
6
+ name = "admin_role"
7
+
8
+ assume_role_policy = jsonencode({
9
+ Version = "2012-10-17"
10
+ Statement = [
11
+ {
12
+ Action = "sts:AssumeRole"
13
+ Effect = "Allow"
14
+ Principal = {
15
+ Service = "ec2.amazonaws.com"
16
+ }
17
+ }
18
+ ]
19
+ })
20
+ }
21
+
22
+ resource "aws_iam_role_policy_attachment" "admin_role_policy_attachment" {
23
+ role = aws_iam_role.admin_role.name
24
+ policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
25
+ }
generated/simple/gpt-4o/aws-tf-008/main.tf ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_iam_role" "lambda_execution_role" {
6
+ name = "lambda_execution_role"
7
+
8
+ assume_role_policy = jsonencode({
9
+ Version = "2012-10-17"
10
+ Statement = [
11
+ {
12
+ Action = "sts:AssumeRole"
13
+ Effect = "Allow"
14
+ Principal = {
15
+ Service = "lambda.amazonaws.com"
16
+ }
17
+ }
18
+ ]
19
+ })
20
+ }
21
+
22
+ resource "aws_iam_policy" "lambda_policy" {
23
+ name = "lambda_policy"
24
+ description = "IAM policy for Lambda execution"
25
+
26
+ policy = jsonencode({
27
+ Version = "2012-10-17"
28
+ Statement = [
29
+ {
30
+ Action = [
31
+ "logs:CreateLogGroup",
32
+ "logs:CreateLogStream",
33
+ "logs:PutLogEvents"
34
+ ]
35
+ Effect = "Allow"
36
+ Resource = "arn:aws:logs:*:*:*"
37
+ }
38
+ ]
39
+ })
40
+ }
41
+
42
+ resource "aws_iam_role_policy_attachment" "lambda_policy_attachment" {
43
+ role = aws_iam_role.lambda_execution_role.name
44
+ policy_arn = aws_iam_policy.lambda_policy.arn
45
+ }
46
+
47
+ resource "aws_lambda_function" "my_lambda" {
48
+ function_name = "my_lambda_function"
49
+ role = aws_iam_role.lambda_execution_role.arn
50
+ handler = "index.handler"
51
+ runtime = "nodejs14.x"
52
+ filename = "lambda_function_payload.zip"
53
+
54
+ source_code_hash = filebase64sha256("lambda_function_payload.zip")
55
+ }
56
+
57
+ resource "aws_apigatewayv2_api" "api_gateway" {
58
+ name = "my_api_gateway"
59
+ protocol_type = "HTTP"
60
+ }
61
+
62
+ resource "aws_lambda_permission" "api_gateway_permission" {
63
+ statement_id = "AllowExecutionFromAPIGateway"
64
+ action = "lambda:InvokeFunction"
65
+ function_name = aws_lambda_function.my_lambda.function_name
66
+ principal = "apigateway.amazonaws.com"
67
+ source_arn = "${aws_apigatewayv2_api.api_gateway.execution_arn}/*"
68
+ }
69
+
70
+ resource "aws_apigatewayv2_integration" "api_integration" {
71
+ api_id = aws_apigatewayv2_api.api_gateway.id
72
+ integration_type = "AWS_PROXY"
73
+ integration_uri = aws_lambda_function.my_lambda.invoke_arn
74
+ integration_method = "POST"
75
+ payload_format_version = "2.0"
76
+ }
77
+
78
+ resource "aws_apigatewayv2_route" "api_route" {
79
+ api_id = aws_apigatewayv2_api.api_gateway.id
80
+ route_key = "ANY /{proxy+}"
81
+ target = "integrations/${aws_apigatewayv2_integration.api_integration.id}"
82
+ }
83
+
84
+ resource "aws_apigatewayv2_stage" "api_stage" {
85
+ api_id = aws_apigatewayv2_api.api_gateway.id
86
+ name = "$default"
87
+ auto_deploy = true
88
+ }
generated/simple/gpt-4o/aws-tf-009/main.tf ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-east-1"
3
+ }
4
+
5
+ resource "aws_kms_key" "example" {
6
+ description = "KMS key allowing access to all AWS accounts"
7
+ deletion_window_in_days = 30
8
+
9
+ policy = <<EOF
10
+ {
11
+ "Version": "2012-10-17",
12
+ "Id": "key-default-1",
13
+ "Statement": [
14
+ {
15
+ "Sid": "Enable IAM User Permissions",
16
+ "Effect": "Allow",
17
+ "Principal": {
18
+ "AWS": "*"
19
+ },
20
+ "Action": "kms:*",
21
+ "Resource": "*"
22
+ }
23
+ ]
24
+ }
25
+ EOF
26
+ }
generated/simple/gpt-4o/aws-tf-010/main.tf ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "aws" {
2
+ region = "us-west-2"
3
+ }
4
+
5
+ resource "aws_eks_cluster" "example" {
6
+ name = "example-cluster"
7
+ role_arn = aws_iam_role.eks_cluster_role.arn
8
+
9
+ vpc_config {
10
+ subnet_ids = aws_subnet.example[*].id
11
+ }
12
+ }
13
+
14
+ resource "aws_iam_role" "eks_cluster_role" {
15
+ name = "eksClusterRole"
16
+
17
+ assume_role_policy = jsonencode({
18
+ Version = "2012-10-17"
19
+ Statement = [
20
+ {
21
+ Action = "sts:AssumeRole"
22
+ Effect = "Allow"
23
+ Principal = {
24
+ Service = "eks.amazonaws.com"
25
+ }
26
+ },
27
+ ]
28
+ })
29
+ }
30
+
31
+ resource "aws_iam_role_policy_attachment" "eks_cluster_policy" {
32
+ policy_arn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy"
33
+ role = aws_iam_role.eks_cluster_role.name
34
+ }
35
+
36
+ resource "aws_iam_role_policy_attachment" "eks_service_policy" {
37
+ policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy"
38
+ role = aws_iam_role.eks_cluster_role.name
39
+ }
40
+
41
+ resource "aws_vpc" "example" {
42
+ cidr_block = "10.0.0.0/16"
43
+ }
44
+
45
+ resource "aws_subnet" "example" {
46
+ count = 2
47
+ vpc_id = aws_vpc.example.id
48
+ cidr_block = cidrsubnet(aws_vpc.example.cidr_block, 8, count.index)
49
+ availability_zone = element(data.aws_availability_zones.available.names, count.index)
50
+ }
51
+
52
+ data "aws_availability_zones" "available" {}
generated/simple/gpt-4o/az-arm-001/main.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.Storage/storageAccounts",
7
+ "apiVersion": "2022-09-01",
8
+ "name": "[parameters('storageAccountName')]",
9
+ "location": "[resourceGroup().location]",
10
+ "kind": "StorageV2",
11
+ "sku": {
12
+ "name": "Standard_LRS"
13
+ },
14
+ "properties": {}
15
+ },
16
+ {
17
+ "type": "Microsoft.Storage/storageAccounts/blobServices/containers",
18
+ "apiVersion": "2022-09-01",
19
+ "name": "[format('{0}/default/{1}', parameters('storageAccountName'), parameters('containerName'))]",
20
+ "dependsOn": [
21
+ "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
22
+ ],
23
+ "properties": {
24
+ "publicAccess": "Blob"
25
+ }
26
+ }
27
+ ],
28
+ "parameters": {
29
+ "storageAccountName": {
30
+ "type": "string",
31
+ "metadata": {
32
+ "description": "Name of the storage account"
33
+ }
34
+ },
35
+ "containerName": {
36
+ "type": "string",
37
+ "metadata": {
38
+ "description": "Name of the blob container"
39
+ }
40
+ }
41
+ }
42
+ }
generated/simple/gpt-4o/az-arm-002/main.json ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.Network/virtualNetworks",
7
+ "apiVersion": "2021-05-01",
8
+ "name": "myVnet",
9
+ "location": "[resourceGroup().location]",
10
+ "properties": {
11
+ "addressSpace": {
12
+ "addressPrefixes": [
13
+ "10.0.0.0/16"
14
+ ]
15
+ },
16
+ "subnets": [
17
+ {
18
+ "name": "mySubnet",
19
+ "properties": {
20
+ "addressPrefix": "10.0.0.0/24"
21
+ }
22
+ }
23
+ ]
24
+ }
25
+ },
26
+ {
27
+ "type": "Microsoft.Network/publicIPAddresses",
28
+ "apiVersion": "2021-05-01",
29
+ "name": "myPublicIP",
30
+ "location": "[resourceGroup().location]",
31
+ "properties": {
32
+ "publicIPAllocationMethod": "Dynamic"
33
+ }
34
+ },
35
+ {
36
+ "type": "Microsoft.Network/networkInterfaces",
37
+ "apiVersion": "2021-05-01",
38
+ "name": "myNic",
39
+ "location": "[resourceGroup().location]",
40
+ "properties": {
41
+ "ipConfigurations": [
42
+ {
43
+ "name": "ipconfig1",
44
+ "properties": {
45
+ "subnet": {
46
+ "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', 'myVnet', 'mySubnet')]"
47
+ },
48
+ "publicIPAddress": {
49
+ "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'myPublicIP')]"
50
+ }
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ },
56
+ {
57
+ "type": "Microsoft.Compute/virtualMachines",
58
+ "apiVersion": "2021-07-01",
59
+ "name": "myVM",
60
+ "location": "[resourceGroup().location]",
61
+ "properties": {
62
+ "hardwareProfile": {
63
+ "vmSize": "Standard_DS1_v2"
64
+ },
65
+ "osProfile": {
66
+ "computerName": "myVM",
67
+ "adminUsername": "azureuser",
68
+ "adminPassword": "Password1234!"
69
+ },
70
+ "storageProfile": {
71
+ "imageReference": {
72
+ "publisher": "MicrosoftWindowsServer",
73
+ "offer": "WindowsServer",
74
+ "sku": "2019-Datacenter",
75
+ "version": "latest"
76
+ },
77
+ "osDisk": {
78
+ "createOption": "FromImage"
79
+ }
80
+ },
81
+ "networkProfile": {
82
+ "networkInterfaces": [
83
+ {
84
+ "id": "[resourceId('Microsoft.Network/networkInterfaces', 'myNic')]"
85
+ }
86
+ ]
87
+ }
88
+ }
89
+ },
90
+ {
91
+ "type": "Microsoft.Network/networkSecurityGroups",
92
+ "apiVersion": "2021-05-01",
93
+ "name": "myNSG",
94
+ "location": "[resourceGroup().location]",
95
+ "properties": {
96
+ "securityRules": [
97
+ {
98
+ "name": "RDP",
99
+ "properties": {
100
+ "priority": 1000,
101
+ "protocol": "Tcp",
102
+ "access": "Allow",
103
+ "direction": "Inbound",
104
+ "sourceAddressPrefix": "*",
105
+ "sourcePortRange": "*",
106
+ "destinationAddressPrefix": "*",
107
+ "destinationPortRange": "3389"
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ },
113
+ {
114
+ "type": "Microsoft.Network/networkInterfaces",
115
+ "apiVersion": "2021-05-01",
116
+ "name": "myNic",
117
+ "location": "[resourceGroup().location]",
118
+ "dependsOn": [
119
+ "[resourceId('Microsoft.Network/networkSecurityGroups', 'myNSG')]"
120
+ ],
121
+ "properties": {
122
+ "networkSecurityGroup": {
123
+ "id": "[resourceId('Microsoft.Network/networkSecurityGroups', 'myNSG')]"
124
+ },
125
+ "ipConfigurations": [
126
+ {
127
+ "name": "ipconfig1",
128
+ "properties": {
129
+ "subnet": {
130
+ "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', 'myVnet', 'mySubnet')]"
131
+ },
132
+ "publicIPAddress": {
133
+ "id": "[resourceId('Microsoft.Network/publicIPAddresses', 'myPublicIP')]"
134
+ }
135
+ }
136
+ }
137
+ ]
138
+ }
139
+ }
140
+ ]
141
+ }
generated/simple/gpt-4o/az-arm-003/main.json ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.Sql/servers",
7
+ "apiVersion": "2021-02-01-preview",
8
+ "name": "[parameters('sqlServerName')]",
9
+ "location": "[parameters('location')]",
10
+ "properties": {
11
+ "administratorLogin": "[parameters('administratorLogin')]",
12
+ "administratorLoginPassword": "[parameters('administratorLoginPassword')]"
13
+ },
14
+ "resources": [
15
+ {
16
+ "type": "databases",
17
+ "apiVersion": "2021-02-01-preview",
18
+ "name": "[parameters('databaseName')]",
19
+ "dependsOn": [
20
+ "[resourceId('Microsoft.Sql/servers', parameters('sqlServerName'))]"
21
+ ],
22
+ "properties": {
23
+ "collation": "SQL_Latin1_General_CP1_CI_AS",
24
+ "maxSizeBytes": "2147483648",
25
+ "sampleName": "AdventureWorksLT"
26
+ }
27
+ },
28
+ {
29
+ "type": "transparentDataEncryption",
30
+ "apiVersion": "2021-02-01-preview",
31
+ "name": "current",
32
+ "dependsOn": [
33
+ "[resourceId('Microsoft.Sql/servers/databases', parameters('sqlServerName'), parameters('databaseName'))]"
34
+ ],
35
+ "properties": {
36
+ "status": "Disabled"
37
+ }
38
+ }
39
+ ]
40
+ }
41
+ ],
42
+ "parameters": {
43
+ "sqlServerName": {
44
+ "type": "string",
45
+ "metadata": {
46
+ "description": "Name of the SQL server."
47
+ }
48
+ },
49
+ "location": {
50
+ "type": "string",
51
+ "metadata": {
52
+ "description": "Location for the SQL server."
53
+ }
54
+ },
55
+ "administratorLogin": {
56
+ "type": "string",
57
+ "metadata": {
58
+ "description": "Administrator username for the SQL server."
59
+ }
60
+ },
61
+ "administratorLoginPassword": {
62
+ "type": "securestring",
63
+ "metadata": {
64
+ "description": "Administrator password for the SQL server."
65
+ }
66
+ },
67
+ "databaseName": {
68
+ "type": "string",
69
+ "metadata": {
70
+ "description": "Name of the SQL database."
71
+ }
72
+ }
73
+ }
74
+ }
generated/simple/gpt-4o/az-arm-004/main.json ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.Network/virtualNetworks",
7
+ "apiVersion": "2021-02-01",
8
+ "name": "myVnet",
9
+ "location": "[resourceGroup().location]",
10
+ "properties": {
11
+ "addressSpace": {
12
+ "addressPrefixes": [
13
+ "10.0.0.0/16"
14
+ ]
15
+ },
16
+ "subnets": [
17
+ {
18
+ "name": "myPublicSubnet",
19
+ "properties": {
20
+ "addressPrefix": "10.0.1.0/24"
21
+ }
22
+ }
23
+ ]
24
+ }
25
+ }
26
+ ]
27
+ }
generated/simple/gpt-4o/az-arm-005/main.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.Web/serverfarms",
7
+ "apiVersion": "2021-02-01",
8
+ "name": "myAppServicePlan",
9
+ "location": "[resourceGroup().location]",
10
+ "sku": {
11
+ "name": "F1",
12
+ "tier": "Free"
13
+ },
14
+ "properties": {
15
+ "reserved": false
16
+ }
17
+ },
18
+ {
19
+ "type": "Microsoft.Web/sites",
20
+ "apiVersion": "2021-02-01",
21
+ "name": "myWebApp",
22
+ "location": "[resourceGroup().location]",
23
+ "dependsOn": [
24
+ "[resourceId('Microsoft.Web/serverfarms', 'myAppServicePlan')]"
25
+ ],
26
+ "properties": {
27
+ "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', 'myAppServicePlan')]",
28
+ "httpsOnly": false
29
+ }
30
+ }
31
+ ]
32
+ }
generated/simple/gpt-4o/az-arm-006/main.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.KeyVault/vaults",
7
+ "apiVersion": "2021-04-01-preview",
8
+ "name": "[parameters('keyVaultName')]",
9
+ "location": "[resourceGroup().location]",
10
+ "properties": {
11
+ "sku": {
12
+ "family": "A",
13
+ "name": "standard"
14
+ },
15
+ "tenantId": "[subscription().tenantId]",
16
+ "accessPolicies": [],
17
+ "networkAcls": {
18
+ "bypass": "AzureServices",
19
+ "defaultAction": "Allow",
20
+ "ipRules": [],
21
+ "virtualNetworkRules": []
22
+ }
23
+ }
24
+ }
25
+ ],
26
+ "parameters": {
27
+ "keyVaultName": {
28
+ "type": "string",
29
+ "metadata": {
30
+ "description": "Name of the Key Vault"
31
+ }
32
+ }
33
+ }
34
+ }
generated/simple/gpt-4o/az-arm-007/main.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.Cache/Redis",
7
+ "apiVersion": "2023-01-01",
8
+ "name": "myRedisCache",
9
+ "location": "[resourceGroup().location]",
10
+ "properties": {
11
+ "sku": {
12
+ "name": "Standard",
13
+ "family": "C",
14
+ "capacity": 1
15
+ },
16
+ "enableNonSslPort": true
17
+ }
18
+ }
19
+ ]
20
+ }
generated/simple/gpt-4o/az-arm-008/main.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.EventHub/namespaces",
7
+ "apiVersion": "2022-10-01-preview",
8
+ "name": "myEventHubNamespace",
9
+ "location": "[resourceGroup().location]",
10
+ "sku": {
11
+ "name": "Standard",
12
+ "tier": "Standard",
13
+ "capacity": 1
14
+ },
15
+ "properties": {
16
+ "isAutoInflateEnabled": false,
17
+ "maximumThroughputUnits": 0,
18
+ "publicNetworkAccess": "Enabled"
19
+ }
20
+ }
21
+ ]
22
+ }
generated/simple/gpt-4o/az-arm-009/main.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "resources": [
5
+ {
6
+ "type": "Microsoft.MachineLearningServices/workspaces",
7
+ "apiVersion": "2023-01-01",
8
+ "name": "[parameters('workspaceName')]",
9
+ "location": "[parameters('location')]",
10
+ "properties": {
11
+ "friendlyName": "[parameters('workspaceFriendlyName')]",
12
+ "description": "[parameters('workspaceDescription')]",
13
+ "publicNetworkAccess": "Enabled"
14
+ }
15
+ }
16
+ ],
17
+ "parameters": {
18
+ "workspaceName": {
19
+ "type": "string",
20
+ "metadata": {
21
+ "description": "The name of the Azure Machine Learning workspace."
22
+ }
23
+ },
24
+ "location": {
25
+ "type": "string",
26
+ "metadata": {
27
+ "description": "The location of the Azure Machine Learning workspace."
28
+ }
29
+ },
30
+ "workspaceFriendlyName": {
31
+ "type": "string",
32
+ "defaultValue": "",
33
+ "metadata": {
34
+ "description": "The friendly name of the Azure Machine Learning workspace."
35
+ }
36
+ },
37
+ "workspaceDescription": {
38
+ "type": "string",
39
+ "defaultValue": "",
40
+ "metadata": {
41
+ "description": "The description of the Azure Machine Learning workspace."
42
+ }
43
+ }
44
+ }
45
+ }
generated/simple/gpt-4o/az-arm-010/main.json ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3
+ "contentVersion": "1.0.0.0",
4
+ "parameters": {
5
+ "loadBalancerName": {
6
+ "type": "string",
7
+ "defaultValue": "myLoadBalancer",
8
+ "metadata": {
9
+ "description": "Name of the Load Balancer"
10
+ }
11
+ },
12
+ "publicIPAddressName": {
13
+ "type": "string",
14
+ "defaultValue": "myPublicIP",
15
+ "metadata": {
16
+ "description": "Name of the Public IP Address"
17
+ }
18
+ },
19
+ "publicIPAddressType": {
20
+ "type": "string",
21
+ "defaultValue": "Dynamic",
22
+ "allowedValues": [
23
+ "Dynamic",
24
+ "Static"
25
+ ],
26
+ "metadata": {
27
+ "description": "Type of the Public IP Address"
28
+ }
29
+ },
30
+ "location": {
31
+ "type": "string",
32
+ "defaultValue": "[resourceGroup().location]",
33
+ "metadata": {
34
+ "description": "Location for all resources."
35
+ }
36
+ }
37
+ },
38
+ "resources": [
39
+ {
40
+ "type": "Microsoft.Network/publicIPAddresses",
41
+ "apiVersion": "2023-05-01",
42
+ "name": "[parameters('publicIPAddressName')]",
43
+ "location": "[parameters('location')]",
44
+ "properties": {
45
+ "publicIPAllocationMethod": "[parameters('publicIPAddressType')]"
46
+ }
47
+ },
48
+ {
49
+ "type": "Microsoft.Network/loadBalancers",
50
+ "apiVersion": "2023-05-01",
51
+ "name": "[parameters('loadBalancerName')]",
52
+ "location": "[parameters('location')]",
53
+ "properties": {
54
+ "frontendIPConfigurations": [
55
+ {
56
+ "name": "LoadBalancerFrontEnd",
57
+ "properties": {
58
+ "publicIPAddress": {
59
+ "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))]"
60
+ }
61
+ }
62
+ }
63
+ ],
64
+ "backendAddressPools": [],
65
+ "loadBalancingRules": [],
66
+ "probes": [],
67
+ "inboundNatRules": [],
68
+ "inboundNatPools": []
69
+ }
70
+ }
71
+ ],
72
+ "outputs": {
73
+ "loadBalancerPublicIP": {
74
+ "type": "string",
75
+ "value": "[reference(resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddressName'))).ipAddress]"
76
+ }
77
+ }
78
+ }
generated/simple/gpt-4o/az-tf-001/main.tf ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_storage_account" "example" {
11
+ name = "examplestoracc"
12
+ resource_group_name = azurerm_resource_group.example.name
13
+ location = azurerm_resource_group.example.location
14
+ account_tier = "Standard"
15
+ account_replication_type = "LRS"
16
+ allow_blob_public_access = true
17
+ }
generated/simple/gpt-4o/az-tf-002/main.tf ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_virtual_network" "example" {
11
+ name = "example-vnet"
12
+ address_space = ["10.0.0.0/16"]
13
+ location = azurerm_resource_group.example.location
14
+ resource_group_name = azurerm_resource_group.example.name
15
+ }
16
+
17
+ resource "azurerm_subnet" "example" {
18
+ name = "example-subnet"
19
+ resource_group_name = azurerm_resource_group.example.name
20
+ virtual_network_name = azurerm_virtual_network.example.name
21
+ address_prefixes = ["10.0.1.0/24"]
22
+ }
23
+
24
+ resource "azurerm_network_interface" "example" {
25
+ name = "example-nic"
26
+ location = azurerm_resource_group.example.location
27
+ resource_group_name = azurerm_resource_group.example.name
28
+
29
+ ip_configuration {
30
+ name = "internal"
31
+ subnet_id = azurerm_subnet.example.id
32
+ private_ip_address_allocation = "Dynamic"
33
+ public_ip_address_id = azurerm_public_ip.example.id
34
+ }
35
+ }
36
+
37
+ resource "azurerm_public_ip" "example" {
38
+ name = "example-pip"
39
+ location = azurerm_resource_group.example.location
40
+ resource_group_name = azurerm_resource_group.example.name
41
+ allocation_method = "Dynamic"
42
+ }
43
+
44
+ resource "azurerm_network_security_group" "example" {
45
+ name = "example-nsg"
46
+ location = azurerm_resource_group.example.location
47
+ resource_group_name = azurerm_resource_group.example.name
48
+
49
+ security_rule {
50
+ name = "SSH"
51
+ priority = 1001
52
+ direction = "Inbound"
53
+ access = "Allow"
54
+ protocol = "Tcp"
55
+ source_port_range = "*"
56
+ destination_port_range = "22"
57
+ source_address_prefix = "*"
58
+ destination_address_prefix = "*"
59
+ }
60
+ }
61
+
62
+ resource "azurerm_network_interface_security_group_association" "example" {
63
+ network_interface_id = azurerm_network_interface.example.id
64
+ network_security_group_id = azurerm_network_security_group.example.id
65
+ }
66
+
67
+ resource "azurerm_linux_virtual_machine" "example" {
68
+ name = "example-vm"
69
+ resource_group_name = azurerm_resource_group.example.name
70
+ location = azurerm_resource_group.example.location
71
+ size = "Standard_B1s"
72
+
73
+ admin_username = "adminuser"
74
+ admin_password = "P@ssw0rd1234!"
75
+
76
+ network_interface_ids = [
77
+ azurerm_network_interface.example.id,
78
+ ]
79
+
80
+ os_disk {
81
+ caching = "ReadWrite"
82
+ storage_account_type = "Standard_LRS"
83
+ }
84
+
85
+ source_image_reference {
86
+ publisher = "Canonical"
87
+ offer = "UbuntuServer"
88
+ sku = "18.04-LTS"
89
+ version = "latest"
90
+ }
91
+ }
generated/simple/gpt-4o/az-tf-003/main.tf ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_sql_server" "example" {
11
+ name = "example-sqlserver"
12
+ resource_group_name = azurerm_resource_group.example.name
13
+ location = azurerm_resource_group.example.location
14
+ version = "12.0"
15
+ administrator_login = "sqladmin"
16
+ administrator_login_password = "H@Sh1CoR3!"
17
+ }
18
+
19
+ resource "azurerm_sql_database" "example" {
20
+ name = "example-sqldb"
21
+ resource_group_name = azurerm_resource_group.example.name
22
+ location = azurerm_resource_group.example.location
23
+ server_name = azurerm_sql_server.example.name
24
+ sku_name = "S0"
25
+ }
26
+
27
+ resource "azurerm_sql_firewall_rule" "allow_all" {
28
+ name = "AllowAllIps"
29
+ resource_group_name = azurerm_resource_group.example.name
30
+ server_name = azurerm_sql_server.example.name
31
+ start_ip_address = "0.0.0.0"
32
+ end_ip_address = "255.255.255.255"
33
+ }
generated/simple/gpt-4o/az-tf-004/main.tf ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_virtual_network" "example" {
11
+ name = "example-vnet"
12
+ address_space = ["10.0.0.0/16"]
13
+ location = azurerm_resource_group.example.location
14
+ resource_group_name = azurerm_resource_group.example.name
15
+ }
16
+
17
+ resource "azurerm_subnet" "example" {
18
+ name = "default"
19
+ resource_group_name = azurerm_resource_group.example.name
20
+ virtual_network_name = azurerm_virtual_network.example.name
21
+ address_prefixes = ["10.0.1.0/24"]
22
+ }
generated/simple/gpt-4o/az-tf-005/main.tf ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_kubernetes_cluster" "example" {
11
+ name = "example-aks-cluster"
12
+ location = azurerm_resource_group.example.location
13
+ resource_group_name = azurerm_resource_group.example.name
14
+ dns_prefix = "exampleaks"
15
+
16
+ default_node_pool {
17
+ name = "default"
18
+ node_count = 1
19
+ vm_size = "Standard_DS2_v2"
20
+ }
21
+
22
+ identity {
23
+ type = "SystemAssigned"
24
+ }
25
+
26
+ role_based_access_control {
27
+ enabled = false
28
+ }
29
+ }
generated/simple/gpt-4o/az-tf-006/main.tf ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "West Europe"
8
+ }
9
+
10
+ resource "azurerm_storage_account" "example" {
11
+ name = "examplestorageacct"
12
+ resource_group_name = azurerm_resource_group.example.name
13
+ location = azurerm_resource_group.example.location
14
+ account_tier = "Standard"
15
+ account_replication_type = "LRS"
16
+ }
17
+
18
+ resource "azurerm_app_service_plan" "example" {
19
+ name = "example-app-service-plan"
20
+ location = azurerm_resource_group.example.location
21
+ resource_group_name = azurerm_resource_group.example.name
22
+ sku {
23
+ tier = "Dynamic"
24
+ size = "Y1"
25
+ }
26
+ }
27
+
28
+ resource "azurerm_function_app" "example" {
29
+ name = "example-function-app"
30
+ location = azurerm_resource_group.example.location
31
+ resource_group_name = azurerm_resource_group.example.name
32
+ app_service_plan_id = azurerm_app_service_plan.example.id
33
+ storage_account_name = azurerm_storage_account.example.name
34
+ storage_account_access_key = azurerm_storage_account.example.primary_access_key
35
+ os_type = "linux"
36
+
37
+ site_config {
38
+ cors {
39
+ allowed_origins = ["*"]
40
+ }
41
+ }
42
+
43
+ app_settings = {
44
+ "FUNCTIONS_WORKER_RUNTIME" = "dotnet"
45
+ "WEBSITE_RUN_FROM_PACKAGE" = "1"
46
+ }
47
+
48
+ identity {
49
+ type = "SystemAssigned"
50
+ }
51
+ }
generated/simple/gpt-4o/az-tf-007/main.tf ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_key_vault" "example" {
11
+ name = "examplekeyvault"
12
+ location = azurerm_resource_group.example.location
13
+ resource_group_name = azurerm_resource_group.example.name
14
+ tenant_id = "00000000-0000-0000-0000-000000000000"
15
+ sku_name = "standard"
16
+
17
+ network_acls {
18
+ default_action = "Allow"
19
+ bypass = "AzureServices"
20
+ }
21
+ }
generated/simple/gpt-4o/az-tf-008/main.tf ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_cosmosdb_account" "example" {
11
+ name = "example-cosmosdb-account"
12
+ location = azurerm_resource_group.example.location
13
+ resource_group_name = azurerm_resource_group.example.name
14
+ offer_type = "Standard"
15
+ kind = "GlobalDocumentDB"
16
+
17
+ consistency_policy {
18
+ consistency_level = "Session"
19
+ }
20
+
21
+ geo_location {
22
+ location = azurerm_resource_group.example.location
23
+ failover_priority = 0
24
+ }
25
+ }
generated/simple/gpt-4o/az-tf-009/main.tf ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "East US"
8
+ }
9
+
10
+ resource "azurerm_network_security_group" "example" {
11
+ name = "example-nsg"
12
+ location = azurerm_resource_group.example.location
13
+ resource_group_name = azurerm_resource_group.example.name
14
+
15
+ security_rule {
16
+ name = "Allow-RDP"
17
+ priority = 100
18
+ direction = "Inbound"
19
+ access = "Allow"
20
+ protocol = "Tcp"
21
+ source_port_range = "*"
22
+ destination_port_range = "3389"
23
+ source_address_prefix = "*"
24
+ destination_address_prefix = "*"
25
+ }
26
+ }
generated/simple/gpt-4o/az-tf-010/main.tf ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "azurerm" {
2
+ features {}
3
+ }
4
+
5
+ resource "azurerm_resource_group" "example" {
6
+ name = "example-resources"
7
+ location = "West Europe"
8
+ }
9
+
10
+ resource "azurerm_container_registry" "example" {
11
+ name = "exampleacr"
12
+ resource_group_name = azurerm_resource_group.example.name
13
+ location = azurerm_resource_group.example.location
14
+ sku = "Basic"
15
+ admin_enabled = true
16
+ }
generated/simple/gpt-4o/gcp-tf-001/main.tf ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_storage_bucket" "public_bucket" {
7
+ name = "your-unique-bucket-name"
8
+ location = "US"
9
+ }
10
+
11
+ resource "google_storage_bucket_iam_member" "public_access" {
12
+ bucket = google_storage_bucket.public_bucket.name
13
+ role = "roles/storage.objectViewer"
14
+ member = "allUsers"
15
+ }
generated/simple/gpt-4o/gcp-tf-002/main.tf ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_compute_network" "vpc_network" {
7
+ name = "my-vpc-network"
8
+ }
9
+
10
+ resource "google_compute_instance" "vm_instance" {
11
+ name = "my-vm-instance"
12
+ machine_type = "e2-medium"
13
+ zone = "us-central1-a"
14
+
15
+ boot_disk {
16
+ initialize_params {
17
+ image = "debian-cloud/debian-11"
18
+ }
19
+ }
20
+
21
+ network_interface {
22
+ network = google_compute_network.vpc_network.name
23
+
24
+ access_config {
25
+ // Ephemeral public IP
26
+ }
27
+ }
28
+ }
29
+
30
+ resource "google_compute_firewall" "allow-all" {
31
+ name = "allow-all"
32
+ network = google_compute_network.vpc_network.name
33
+
34
+ allow {
35
+ protocol = "tcp"
36
+ ports = ["0-65535"]
37
+ }
38
+
39
+ allow {
40
+ protocol = "udp"
41
+ ports = ["0-65535"]
42
+ }
43
+
44
+ allow {
45
+ protocol = "icmp"
46
+ }
47
+
48
+ source_ranges = ["0.0.0.0/0"]
49
+ }
generated/simple/gpt-4o/gcp-tf-003/main.tf ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_sql_database_instance" "postgres_instance" {
7
+ name = "postgres-instance"
8
+ database_version = "POSTGRES_13"
9
+ region = "us-central1"
10
+
11
+ settings {
12
+ tier = "db-f1-micro"
13
+
14
+ ip_configuration {
15
+ ipv4_enabled = true
16
+ authorized_networks {
17
+ name = "all-networks"
18
+ value = "0.0.0.0/0"
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ resource "google_sql_database" "default" {
25
+ name = "default-database"
26
+ instance = google_sql_database_instance.postgres_instance.name
27
+ }
28
+
29
+ resource "google_sql_user" "default" {
30
+ name = "default-user"
31
+ instance = google_sql_database_instance.postgres_instance.name
32
+ password = "your-secure-password"
33
+ }
generated/simple/gpt-4o/gcp-tf-004/main.tf ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_compute_network" "vpc_network" {
7
+ name = "my-vpc-network"
8
+ auto_create_subnetworks = true
9
+ }
generated/simple/gpt-4o/gcp-tf-005/main.tf ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_container_cluster" "primary" {
7
+ name = "my-gke-cluster"
8
+ location = "us-central1"
9
+
10
+ initial_node_count = 3
11
+
12
+ node_config {
13
+ machine_type = "e2-medium"
14
+ }
15
+
16
+ enable_legacy_abac = true
17
+ }
generated/simple/gpt-4o/gcp-tf-006/main.tf ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_storage_bucket" "function_source" {
7
+ name = "your-function-source-bucket"
8
+ location = "US"
9
+ }
10
+
11
+ resource "google_storage_bucket_object" "function_zip" {
12
+ name = "function-source.zip"
13
+ bucket = google_storage_bucket.function_source.name
14
+ source = "path/to/your/function-source.zip"
15
+ }
16
+
17
+ resource "google_cloudfunctions_function" "function" {
18
+ name = "my-cloud-function"
19
+ description = "My Cloud Function"
20
+ runtime = "nodejs16" # Specify the runtime you need
21
+ entry_point = "functionEntryPoint" # Replace with your function's entry point
22
+
23
+ event_trigger {
24
+ event_type = "google.pubsub.topic.publish"
25
+ resource = google_pubsub_topic.topic.id
26
+ }
27
+
28
+ source_archive_bucket = google_storage_bucket.function_source.name
29
+ source_archive_object = google_storage_bucket_object.function_zip.name
30
+
31
+ available_memory_mb = 256
32
+ timeout = 60
33
+ }
34
+
35
+ resource "google_pubsub_topic" "topic" {
36
+ name = "my-topic"
37
+ }
38
+
39
+ resource "google_cloudfunctions_function_iam_member" "noauth" {
40
+ project = google_cloudfunctions_function.function.project
41
+ region = google_cloudfunctions_function.function.region
42
+ cloud_function = google_cloudfunctions_function.function.name
43
+ role = "roles/cloudfunctions.invoker"
44
+ member = "allUsers"
45
+ }
generated/simple/gpt-4o/gcp-tf-007/main.tf ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_bigquery_dataset" "public_dataset" {
7
+ dataset_id = "public_dataset"
8
+ location = "US"
9
+
10
+ access {
11
+ role = "READER"
12
+ special_group = "allAuthenticatedUsers"
13
+ }
14
+ }
generated/simple/gpt-4o/gcp-tf-008/main.tf ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_pubsub_topic" "my_topic" {
7
+ name = "my-topic"
8
+ }
9
+
10
+ resource "google_pubsub_topic_iam_member" "all_users" {
11
+ topic = google_pubsub_topic.my_topic.name
12
+ role = "roles/pubsub.publisher"
13
+ member = "allUsers"
14
+ }
generated/simple/gpt-4o/gcp-tf-009/main.tf ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ credentials = file("<YOUR_CREDENTIALS_FILE>.json")
3
+ project = "<YOUR_PROJECT_ID>"
4
+ region = "<YOUR_REGION>"
5
+ }
6
+
7
+ resource "google_service_account" "my_service_account" {
8
+ account_id = "my-service-account"
9
+ display_name = "My Service Account"
10
+ }
11
+
12
+ resource "google_project_iam_member" "editor_role" {
13
+ project = "<YOUR_PROJECT_ID>"
14
+ role = "roles/editor"
15
+ member = "serviceAccount:${google_service_account.my_service_account.email}"
16
+ }
generated/simple/gpt-4o/gcp-tf-010/main.tf ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ provider "google" {
2
+ project = "your-gcp-project-id"
3
+ region = "us-central1"
4
+ }
5
+
6
+ resource "google_cloud_run_service" "default" {
7
+ name = "my-cloud-run-service"
8
+ location = "us-central1"
9
+
10
+ template {
11
+ spec {
12
+ containers {
13
+ image = "gcr.io/cloudrun/hello"
14
+ }
15
+ }
16
+ }
17
+
18
+ traffic {
19
+ percent = 100
20
+ latest_revision = true
21
+ }
22
+ }
23
+
24
+ resource "google_cloud_run_service_iam_member" "noauth" {
25
+ service = google_cloud_run_service.default.name
26
+ location = google_cloud_run_service.default.location
27
+ role = "roles/run.invoker"
28
+ member = "allUsers"
29
+ }