Datasets:
Commit ·
aafb3a5
1
Parent(s): 817fa4a
Add generated/simple/gemini-3.1-pro/
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- generated/simple/gemini-3.1-pro/aws-cfn-001/main.yaml +70 -0
- generated/simple/gemini-3.1-pro/aws-cfn-002/main.yaml +56 -0
- generated/simple/gemini-3.1-pro/aws-cfn-003/main.yaml +99 -0
- generated/simple/gemini-3.1-pro/aws-cfn-004/main.yaml +114 -0
- generated/simple/gemini-3.1-pro/aws-cfn-005/main.yaml +15 -0
- generated/simple/gemini-3.1-pro/aws-cfn-006/main.yaml +76 -0
- generated/simple/gemini-3.1-pro/aws-cfn-007/main.yaml +180 -0
- generated/simple/gemini-3.1-pro/aws-cfn-008/main.yaml +27 -0
- generated/simple/gemini-3.1-pro/aws-cfn-009/main.yaml +264 -0
- generated/simple/gemini-3.1-pro/aws-cfn-010/main.yaml +59 -0
- generated/simple/gemini-3.1-pro/aws-tf-001/main.tf +72 -0
- generated/simple/gemini-3.1-pro/aws-tf-002/main.tf +47 -0
- generated/simple/gemini-3.1-pro/aws-tf-003/main.tf +139 -0
- generated/simple/gemini-3.1-pro/aws-tf-004/main.tf +278 -0
- generated/simple/gemini-3.1-pro/aws-tf-005/main.tf +156 -0
- generated/simple/gemini-3.1-pro/aws-tf-006/main.tf +110 -0
- generated/simple/gemini-3.1-pro/aws-tf-007/main.tf +27 -0
- generated/simple/gemini-3.1-pro/aws-tf-008/main.tf +107 -0
- generated/simple/gemini-3.1-pro/aws-tf-009/main.tf +25 -0
- generated/simple/gemini-3.1-pro/aws-tf-010/main.tf +100 -0
- generated/simple/gemini-3.1-pro/az-arm-001/main.json +52 -0
- generated/simple/gemini-3.1-pro/az-arm-002/main.json +188 -0
- generated/simple/gemini-3.1-pro/az-arm-003/main.json +78 -0
- generated/simple/gemini-3.1-pro/az-arm-004/main.json +74 -0
- generated/simple/gemini-3.1-pro/az-arm-005/main.json +62 -0
- generated/simple/gemini-3.1-pro/az-arm-006/main.json +57 -0
- generated/simple/gemini-3.1-pro/az-arm-007/main.json +74 -0
- generated/simple/gemini-3.1-pro/az-arm-008/main.json +68 -0
- generated/simple/gemini-3.1-pro/az-arm-009/main.json +121 -0
- generated/simple/gemini-3.1-pro/az-arm-010/main.json +113 -0
- generated/simple/gemini-3.1-pro/az-tf-001/main.tf +36 -0
- generated/simple/gemini-3.1-pro/az-tf-002/main.tf +125 -0
- generated/simple/gemini-3.1-pro/az-tf-003/main.tf +55 -0
- generated/simple/gemini-3.1-pro/az-tf-004/main.tf +31 -0
- generated/simple/gemini-3.1-pro/az-tf-005/main.tf +41 -0
- generated/simple/gemini-3.1-pro/az-tf-006/main.tf +62 -0
- generated/simple/gemini-3.1-pro/az-tf-007/main.tf +49 -0
- generated/simple/gemini-3.1-pro/az-tf-008/main.tf +37 -0
- generated/simple/gemini-3.1-pro/az-tf-009/main.tf +45 -0
- generated/simple/gemini-3.1-pro/az-tf-010/main.tf +54 -0
- generated/simple/gemini-3.1-pro/gcp-tf-001/main.tf +34 -0
- generated/simple/gemini-3.1-pro/gcp-tf-002/main.tf +58 -0
- generated/simple/gemini-3.1-pro/gcp-tf-003/main.tf +48 -0
- generated/simple/gemini-3.1-pro/gcp-tf-004/main.tf +4 -0
- generated/simple/gemini-3.1-pro/gcp-tf-005/main.tf +65 -0
- generated/simple/gemini-3.1-pro/gcp-tf-006/main.tf +73 -0
- generated/simple/gemini-3.1-pro/gcp-tf-007/main.tf +21 -0
- generated/simple/gemini-3.1-pro/gcp-tf-008/main.tf +30 -0
- generated/simple/gemini-3.1-pro/gcp-tf-009/main.tf +22 -0
- generated/simple/gemini-3.1-pro/gcp-tf-010/main.tf +26 -0
generated/simple/gemini-3.1-pro/aws-cfn-001/main.yaml
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Production-ready CloudFormation template to create a public S3 bucket for static assets.'
|
| 3 |
+
|
| 4 |
+
Resources:
|
| 5 |
+
StaticAssetsBucket:
|
| 6 |
+
Type: AWS::S3::Bucket
|
| 7 |
+
Properties:
|
| 8 |
+
# Explicitly disable Block Public Access to allow public read policies
|
| 9 |
+
PublicAccessBlockConfiguration:
|
| 10 |
+
BlockPublicAcls: false
|
| 11 |
+
BlockPublicPolicy: false
|
| 12 |
+
IgnorePublicAcls: false
|
| 13 |
+
RestrictPublicBuckets: false
|
| 14 |
+
# Disable ACLs (AWS Best Practice) and rely entirely on Bucket Policies
|
| 15 |
+
OwnershipControls:
|
| 16 |
+
Rules:
|
| 17 |
+
- ObjectOwnership: BucketOwnerEnforced
|
| 18 |
+
# Enable static website hosting (optional but common for static assets)
|
| 19 |
+
WebsiteConfiguration:
|
| 20 |
+
IndexDocument: index.html
|
| 21 |
+
ErrorDocument: error.html
|
| 22 |
+
# Enable CORS for web applications to fetch assets
|
| 23 |
+
CorsConfiguration:
|
| 24 |
+
CorsRules:
|
| 25 |
+
- AllowedHeaders:
|
| 26 |
+
- '*'
|
| 27 |
+
AllowedMethods:
|
| 28 |
+
- GET
|
| 29 |
+
- HEAD
|
| 30 |
+
AllowedOrigins:
|
| 31 |
+
- '*'
|
| 32 |
+
MaxAge: 3600
|
| 33 |
+
|
| 34 |
+
StaticAssetsBucketPolicy:
|
| 35 |
+
Type: AWS::S3::BucketPolicy
|
| 36 |
+
Properties:
|
| 37 |
+
Bucket: !Ref StaticAssetsBucket
|
| 38 |
+
PolicyDocument:
|
| 39 |
+
Version: '2012-10-17'
|
| 40 |
+
Statement:
|
| 41 |
+
- Sid: PublicReadGetObject
|
| 42 |
+
Effect: Allow
|
| 43 |
+
Principal: '*'
|
| 44 |
+
Action: s3:GetObject
|
| 45 |
+
Resource: !Sub '${StaticAssetsBucket.Arn}/*'
|
| 46 |
+
|
| 47 |
+
Outputs:
|
| 48 |
+
BucketName:
|
| 49 |
+
Description: Name of the static assets bucket
|
| 50 |
+
Value: !Ref StaticAssetsBucket
|
| 51 |
+
Export:
|
| 52 |
+
Name: !Sub '${AWS::StackName}-BucketName'
|
| 53 |
+
|
| 54 |
+
BucketArn:
|
| 55 |
+
Description: ARN of the static assets bucket
|
| 56 |
+
Value: !GetAtt StaticAssetsBucket.Arn
|
| 57 |
+
Export:
|
| 58 |
+
Name: !Sub '${AWS::StackName}-BucketArn'
|
| 59 |
+
|
| 60 |
+
BucketDomainName:
|
| 61 |
+
Description: Domain name of the static assets bucket
|
| 62 |
+
Value: !GetAtt StaticAssetsBucket.DomainName
|
| 63 |
+
Export:
|
| 64 |
+
Name: !Sub '${AWS::StackName}-BucketDomainName'
|
| 65 |
+
|
| 66 |
+
BucketWebsiteURL:
|
| 67 |
+
Description: Website URL of the static assets bucket
|
| 68 |
+
Value: !GetAtt StaticAssetsBucket.WebsiteURL
|
| 69 |
+
Export:
|
| 70 |
+
Name: !Sub '${AWS::StackName}-BucketWebsiteURL'
|
generated/simple/gemini-3.1-pro/aws-cfn-002/main.yaml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Provision an EC2 instance with a security group open on ports 22 and 80'
|
| 3 |
+
|
| 4 |
+
Parameters:
|
| 5 |
+
InstanceType:
|
| 6 |
+
Description: EC2 instance type
|
| 7 |
+
Type: String
|
| 8 |
+
Default: t3.micro
|
| 9 |
+
AllowedValues:
|
| 10 |
+
- t2.micro
|
| 11 |
+
- t3.micro
|
| 12 |
+
- t3.small
|
| 13 |
+
- m5.large
|
| 14 |
+
LatestAmiId:
|
| 15 |
+
Description: SSM Parameter to get the latest Amazon Linux 2023 AMI ID
|
| 16 |
+
Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
|
| 17 |
+
Default: '/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64'
|
| 18 |
+
|
| 19 |
+
Resources:
|
| 20 |
+
InstanceSecurityGroup:
|
| 21 |
+
Type: AWS::EC2::SecurityGroup
|
| 22 |
+
Properties:
|
| 23 |
+
GroupDescription: Allow SSH and HTTP inbound traffic
|
| 24 |
+
SecurityGroupIngress:
|
| 25 |
+
- IpProtocol: tcp
|
| 26 |
+
FromPort: 22
|
| 27 |
+
ToPort: 22
|
| 28 |
+
CidrIp: 0.0.0.0/0
|
| 29 |
+
Description: Allow SSH
|
| 30 |
+
- IpProtocol: tcp
|
| 31 |
+
FromPort: 80
|
| 32 |
+
ToPort: 80
|
| 33 |
+
CidrIp: 0.0.0.0/0
|
| 34 |
+
Description: Allow HTTP
|
| 35 |
+
|
| 36 |
+
WebInstance:
|
| 37 |
+
Type: AWS::EC2::Instance
|
| 38 |
+
Properties:
|
| 39 |
+
InstanceType: !Ref InstanceType
|
| 40 |
+
ImageId: !Ref LatestAmiId
|
| 41 |
+
SecurityGroupIds:
|
| 42 |
+
- !GetAtt InstanceSecurityGroup.GroupId
|
| 43 |
+
Tags:
|
| 44 |
+
- Key: Name
|
| 45 |
+
Value: WebServerInstance
|
| 46 |
+
|
| 47 |
+
Outputs:
|
| 48 |
+
InstanceId:
|
| 49 |
+
Description: The Instance ID of the provisioned EC2 instance
|
| 50 |
+
Value: !Ref WebInstance
|
| 51 |
+
PublicIp:
|
| 52 |
+
Description: Public IP address of the provisioned EC2 instance
|
| 53 |
+
Value: !GetAtt WebInstance.PublicIp
|
| 54 |
+
PublicDnsName:
|
| 55 |
+
Description: Public DNS Name of the provisioned EC2 instance
|
| 56 |
+
Value: !GetAtt WebInstance.PublicDnsName
|
generated/simple/gemini-3.1-pro/aws-cfn-003/main.yaml
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Deploy an RDS MySQL database with no encryption at rest.'
|
| 3 |
+
|
| 4 |
+
Parameters:
|
| 5 |
+
DBName:
|
| 6 |
+
Type: String
|
| 7 |
+
Description: Name of the MySQL database
|
| 8 |
+
Default: mydatabase
|
| 9 |
+
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
|
| 10 |
+
DBUser:
|
| 11 |
+
Type: String
|
| 12 |
+
Description: Master username for the database
|
| 13 |
+
Default: admin
|
| 14 |
+
AllowedPattern: '[a-zA-Z][a-zA-Z0-9]*'
|
| 15 |
+
DBPassword:
|
| 16 |
+
Type: String
|
| 17 |
+
Description: Master password for the database
|
| 18 |
+
NoEcho: true
|
| 19 |
+
MinLength: 8
|
| 20 |
+
DBInstanceClass:
|
| 21 |
+
Type: String
|
| 22 |
+
Description: The database instance type
|
| 23 |
+
Default: db.t3.micro
|
| 24 |
+
AllowedValues:
|
| 25 |
+
- db.t3.micro
|
| 26 |
+
- db.t3.small
|
| 27 |
+
- db.t3.medium
|
| 28 |
+
- db.m5.large
|
| 29 |
+
- db.m5.xlarge
|
| 30 |
+
AllocatedStorage:
|
| 31 |
+
Type: Number
|
| 32 |
+
Description: The size of the database (Gb)
|
| 33 |
+
Default: 20
|
| 34 |
+
MinValue: 20
|
| 35 |
+
MaxValue: 1000
|
| 36 |
+
VpcId:
|
| 37 |
+
Type: AWS::EC2::VPC::Id
|
| 38 |
+
Description: VPC ID where the database will be deployed
|
| 39 |
+
SubnetIds:
|
| 40 |
+
Type: List<AWS::EC2::Subnet::Id>
|
| 41 |
+
Description: List of Subnet IDs for the DB Subnet Group (must be in at least 2 AZs)
|
| 42 |
+
|
| 43 |
+
Resources:
|
| 44 |
+
DBSubnetGroup:
|
| 45 |
+
Type: AWS::RDS::DBSubnetGroup
|
| 46 |
+
Properties:
|
| 47 |
+
DBSubnetGroupDescription: Subnet group for MySQL RDS instance
|
| 48 |
+
SubnetIds: !Ref SubnetIds
|
| 49 |
+
Tags:
|
| 50 |
+
- Key: Name
|
| 51 |
+
Value: !Sub ${AWS::StackName}-subnet-group
|
| 52 |
+
|
| 53 |
+
DBSecurityGroup:
|
| 54 |
+
Type: AWS::EC2::SecurityGroup
|
| 55 |
+
Properties:
|
| 56 |
+
GroupDescription: Allow MySQL inbound traffic
|
| 57 |
+
VpcId: !Ref VpcId
|
| 58 |
+
SecurityGroupIngress:
|
| 59 |
+
- IpProtocol: tcp
|
| 60 |
+
FromPort: 3306
|
| 61 |
+
ToPort: 3306
|
| 62 |
+
CidrIp: 10.0.0.0/8
|
| 63 |
+
Tags:
|
| 64 |
+
- Key: Name
|
| 65 |
+
Value: !Sub ${AWS::StackName}-sg
|
| 66 |
+
|
| 67 |
+
MySQLDBInstance:
|
| 68 |
+
Type: AWS::RDS::DBInstance
|
| 69 |
+
DeletionPolicy: Snapshot
|
| 70 |
+
UpdateReplacePolicy: Snapshot
|
| 71 |
+
Properties:
|
| 72 |
+
Engine: mysql
|
| 73 |
+
EngineVersion: '8.0'
|
| 74 |
+
DBInstanceClass: !Ref DBInstanceClass
|
| 75 |
+
AllocatedStorage: !Ref AllocatedStorage
|
| 76 |
+
StorageType: gp3
|
| 77 |
+
DBName: !Ref DBName
|
| 78 |
+
MasterUsername: !Ref DBUser
|
| 79 |
+
MasterUserPassword: !Ref DBPassword
|
| 80 |
+
DBSubnetGroupName: !Ref DBSubnetGroup
|
| 81 |
+
VPCSecurityGroups:
|
| 82 |
+
- !Ref DBSecurityGroup
|
| 83 |
+
StorageEncrypted: false
|
| 84 |
+
PubliclyAccessible: false
|
| 85 |
+
MultiAZ: false
|
| 86 |
+
AutoMinorVersionUpgrade: true
|
| 87 |
+
BackupRetentionPeriod: 7
|
| 88 |
+
CopyTagsToSnapshot: true
|
| 89 |
+
Tags:
|
| 90 |
+
- Key: Name
|
| 91 |
+
Value: !Sub ${AWS::StackName}-mysql-db
|
| 92 |
+
|
| 93 |
+
Outputs:
|
| 94 |
+
DBEndpointAddress:
|
| 95 |
+
Description: The connection endpoint for the MySQL database
|
| 96 |
+
Value: !GetAtt MySQLDBInstance.Endpoint.Address
|
| 97 |
+
DBEndpointPort:
|
| 98 |
+
Description: The port for the MySQL database
|
| 99 |
+
Value: !GetAtt MySQLDBInstance.Endpoint.Port
|
generated/simple/gemini-3.1-pro/aws-cfn-004/main.yaml
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Production-ready VPC with two public subnets across two Availability Zones.'
|
| 3 |
+
|
| 4 |
+
Parameters:
|
| 5 |
+
VpcCidr:
|
| 6 |
+
Type: String
|
| 7 |
+
Default: 10.0.0.0/16
|
| 8 |
+
Description: CIDR block for the VPC
|
| 9 |
+
AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$
|
| 10 |
+
|
| 11 |
+
PublicSubnet1Cidr:
|
| 12 |
+
Type: String
|
| 13 |
+
Default: 10.0.1.0/24
|
| 14 |
+
Description: CIDR block for Public Subnet 1
|
| 15 |
+
AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$
|
| 16 |
+
|
| 17 |
+
PublicSubnet2Cidr:
|
| 18 |
+
Type: String
|
| 19 |
+
Default: 10.0.2.0/24
|
| 20 |
+
Description: CIDR block for Public Subnet 2
|
| 21 |
+
AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$
|
| 22 |
+
|
| 23 |
+
Resources:
|
| 24 |
+
VPC:
|
| 25 |
+
Type: AWS::EC2::VPC
|
| 26 |
+
Properties:
|
| 27 |
+
CidrBlock: !Ref VpcCidr
|
| 28 |
+
EnableDnsSupport: true
|
| 29 |
+
EnableDnsHostnames: true
|
| 30 |
+
Tags:
|
| 31 |
+
- Key: Name
|
| 32 |
+
Value: !Sub ${AWS::StackName}-vpc
|
| 33 |
+
|
| 34 |
+
InternetGateway:
|
| 35 |
+
Type: AWS::EC2::InternetGateway
|
| 36 |
+
Properties:
|
| 37 |
+
Tags:
|
| 38 |
+
- Key: Name
|
| 39 |
+
Value: !Sub ${AWS::StackName}-igw
|
| 40 |
+
|
| 41 |
+
VPCGatewayAttachment:
|
| 42 |
+
Type: AWS::EC2::VPCGatewayAttachment
|
| 43 |
+
Properties:
|
| 44 |
+
VpcId: !Ref VPC
|
| 45 |
+
InternetGatewayId: !Ref InternetGateway
|
| 46 |
+
|
| 47 |
+
PublicSubnet1:
|
| 48 |
+
Type: AWS::EC2::Subnet
|
| 49 |
+
Properties:
|
| 50 |
+
VpcId: !Ref VPC
|
| 51 |
+
CidrBlock: !Ref PublicSubnet1Cidr
|
| 52 |
+
AvailabilityZone: !Select [ 0, !GetAZs '' ]
|
| 53 |
+
MapPublicIpOnLaunch: true
|
| 54 |
+
Tags:
|
| 55 |
+
- Key: Name
|
| 56 |
+
Value: !Sub ${AWS::StackName}-public-subnet-1
|
| 57 |
+
|
| 58 |
+
PublicSubnet2:
|
| 59 |
+
Type: AWS::EC2::Subnet
|
| 60 |
+
Properties:
|
| 61 |
+
VpcId: !Ref VPC
|
| 62 |
+
CidrBlock: !Ref PublicSubnet2Cidr
|
| 63 |
+
AvailabilityZone: !Select [ 1, !GetAZs '' ]
|
| 64 |
+
MapPublicIpOnLaunch: true
|
| 65 |
+
Tags:
|
| 66 |
+
- Key: Name
|
| 67 |
+
Value: !Sub ${AWS::StackName}-public-subnet-2
|
| 68 |
+
|
| 69 |
+
PublicRouteTable:
|
| 70 |
+
Type: AWS::EC2::RouteTable
|
| 71 |
+
Properties:
|
| 72 |
+
VpcId: !Ref VPC
|
| 73 |
+
Tags:
|
| 74 |
+
- Key: Name
|
| 75 |
+
Value: !Sub ${AWS::StackName}-public-rt
|
| 76 |
+
|
| 77 |
+
PublicRoute:
|
| 78 |
+
Type: AWS::EC2::Route
|
| 79 |
+
DependsOn: VPCGatewayAttachment
|
| 80 |
+
Properties:
|
| 81 |
+
RouteTableId: !Ref PublicRouteTable
|
| 82 |
+
DestinationCidrBlock: 0.0.0.0/0
|
| 83 |
+
GatewayId: !Ref InternetGateway
|
| 84 |
+
|
| 85 |
+
PublicSubnet1RouteTableAssociation:
|
| 86 |
+
Type: AWS::EC2::SubnetRouteTableAssociation
|
| 87 |
+
Properties:
|
| 88 |
+
SubnetId: !Ref PublicSubnet1
|
| 89 |
+
RouteTableId: !Ref PublicRouteTable
|
| 90 |
+
|
| 91 |
+
PublicSubnet2RouteTableAssociation:
|
| 92 |
+
Type: AWS::EC2::SubnetRouteTableAssociation
|
| 93 |
+
Properties:
|
| 94 |
+
SubnetId: !Ref PublicSubnet2
|
| 95 |
+
RouteTableId: !Ref PublicRouteTable
|
| 96 |
+
|
| 97 |
+
Outputs:
|
| 98 |
+
VpcId:
|
| 99 |
+
Description: The ID of the VPC
|
| 100 |
+
Value: !Ref VPC
|
| 101 |
+
Export:
|
| 102 |
+
Name: !Sub ${AWS::StackName}-VpcId
|
| 103 |
+
|
| 104 |
+
PublicSubnet1Id:
|
| 105 |
+
Description: The ID of Public Subnet 1
|
| 106 |
+
Value: !Ref PublicSubnet1
|
| 107 |
+
Export:
|
| 108 |
+
Name: !Sub ${AWS::StackName}-PublicSubnet1Id
|
| 109 |
+
|
| 110 |
+
PublicSubnet2Id:
|
| 111 |
+
Description: The ID of Public Subnet 2
|
| 112 |
+
Value: !Ref PublicSubnet2
|
| 113 |
+
Export:
|
| 114 |
+
Name: !Sub ${AWS::StackName}-PublicSubnet2Id
|
generated/simple/gemini-3.1-pro/aws-cfn-005/main.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Deploy an IAM User with an inline policy granting full access'
|
| 3 |
+
|
| 4 |
+
Resources:
|
| 5 |
+
FullAccessUser:
|
| 6 |
+
Type: AWS::IAM::User
|
| 7 |
+
Properties:
|
| 8 |
+
Policies:
|
| 9 |
+
- PolicyName: FullAccessInlinePolicy
|
| 10 |
+
PolicyDocument:
|
| 11 |
+
Version: '2012-10-17'
|
| 12 |
+
Statement:
|
| 13 |
+
- Effect: Allow
|
| 14 |
+
Action: '*'
|
| 15 |
+
Resource: '*'
|
generated/simple/gemini-3.1-pro/aws-cfn-006/main.yaml
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'AWS CloudFormation Template: CloudFront distribution with no WAF attached'
|
| 3 |
+
|
| 4 |
+
Resources:
|
| 5 |
+
OriginBucket:
|
| 6 |
+
Type: AWS::S3::Bucket
|
| 7 |
+
Properties:
|
| 8 |
+
PublicAccessBlockConfiguration:
|
| 9 |
+
BlockPublicAcls: true
|
| 10 |
+
BlockPublicPolicy: true
|
| 11 |
+
IgnorePublicAcls: true
|
| 12 |
+
RestrictPublicBuckets: true
|
| 13 |
+
BucketEncryption:
|
| 14 |
+
ServerSideEncryptionConfiguration:
|
| 15 |
+
- ServerSideEncryptionByDefault:
|
| 16 |
+
SSEAlgorithm: AES256
|
| 17 |
+
|
| 18 |
+
CloudFrontOriginAccessIdentity:
|
| 19 |
+
Type: AWS::CloudFront::CloudFrontOriginAccessIdentity
|
| 20 |
+
Properties:
|
| 21 |
+
CloudFrontOriginAccessIdentityConfig:
|
| 22 |
+
Comment: !Sub 'OAI for ${AWS::StackName}'
|
| 23 |
+
|
| 24 |
+
BucketPolicy:
|
| 25 |
+
Type: AWS::S3::BucketPolicy
|
| 26 |
+
Properties:
|
| 27 |
+
Bucket: !Ref OriginBucket
|
| 28 |
+
PolicyDocument:
|
| 29 |
+
Version: '2012-10-17'
|
| 30 |
+
Statement:
|
| 31 |
+
- Effect: Allow
|
| 32 |
+
Principal:
|
| 33 |
+
CanonicalUser: !GetAtt CloudFrontOriginAccessIdentity.S3CanonicalUserId
|
| 34 |
+
Action: 's3:GetObject'
|
| 35 |
+
Resource: !Sub '${OriginBucket.Arn}/*'
|
| 36 |
+
|
| 37 |
+
CloudFrontDistribution:
|
| 38 |
+
Type: AWS::CloudFront::Distribution
|
| 39 |
+
Properties:
|
| 40 |
+
DistributionConfig:
|
| 41 |
+
Enabled: true
|
| 42 |
+
DefaultRootObject: index.html
|
| 43 |
+
HttpVersion: http2
|
| 44 |
+
IPV6Enabled: true
|
| 45 |
+
Origins:
|
| 46 |
+
- Id: S3-Origin
|
| 47 |
+
DomainName: !GetAtt OriginBucket.RegionalDomainName
|
| 48 |
+
S3OriginConfig:
|
| 49 |
+
OriginAccessIdentity: !Sub 'origin-access-identity/cloudfront/${CloudFrontOriginAccessIdentity}'
|
| 50 |
+
DefaultCacheBehavior:
|
| 51 |
+
TargetOriginId: S3-Origin
|
| 52 |
+
ViewerProtocolPolicy: redirect-to-https
|
| 53 |
+
AllowedMethods:
|
| 54 |
+
- GET
|
| 55 |
+
- HEAD
|
| 56 |
+
- OPTIONS
|
| 57 |
+
CachedMethods:
|
| 58 |
+
- GET
|
| 59 |
+
- HEAD
|
| 60 |
+
ForwardedValues:
|
| 61 |
+
QueryString: false
|
| 62 |
+
Cookies:
|
| 63 |
+
Forward: none
|
| 64 |
+
MinTTL: 0
|
| 65 |
+
DefaultTTL: 3600
|
| 66 |
+
MaxTTL: 86400
|
| 67 |
+
ViewerCertificate:
|
| 68 |
+
CloudFrontDefaultCertificate: true
|
| 69 |
+
|
| 70 |
+
Outputs:
|
| 71 |
+
DistributionId:
|
| 72 |
+
Description: The ID of the CloudFront Distribution
|
| 73 |
+
Value: !Ref CloudFrontDistribution
|
| 74 |
+
DistributionDomainName:
|
| 75 |
+
Description: The domain name of the CloudFront Distribution
|
| 76 |
+
Value: !GetAtt CloudFrontDistribution.DomainName
|
generated/simple/gemini-3.1-pro/aws-cfn-007/main.yaml
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Creates an ElastiCache Redis cluster exposed to the internet via an EC2 HAProxy instance.'
|
| 3 |
+
|
| 4 |
+
Parameters:
|
| 5 |
+
CacheNodeType:
|
| 6 |
+
Type: String
|
| 7 |
+
Default: cache.t3.micro
|
| 8 |
+
Description: The compute and memory capacity of the nodes in the node group.
|
| 9 |
+
ProxyInstanceType:
|
| 10 |
+
Type: String
|
| 11 |
+
Default: t3.micro
|
| 12 |
+
Description: The EC2 instance type for the HAProxy public endpoint.
|
| 13 |
+
|
| 14 |
+
Resources:
|
| 15 |
+
VPC:
|
| 16 |
+
Type: AWS::EC2::VPC
|
| 17 |
+
Properties:
|
| 18 |
+
CidrBlock: 10.0.0.0/16
|
| 19 |
+
EnableDnsSupport: true
|
| 20 |
+
EnableDnsHostnames: true
|
| 21 |
+
Tags:
|
| 22 |
+
- Key: Name
|
| 23 |
+
Value: Redis-Public-VPC
|
| 24 |
+
|
| 25 |
+
InternetGateway:
|
| 26 |
+
Type: AWS::EC2::InternetGateway
|
| 27 |
+
|
| 28 |
+
VPCGatewayAttachment:
|
| 29 |
+
Type: AWS::EC2::VPCGatewayAttachment
|
| 30 |
+
Properties:
|
| 31 |
+
VpcId: !Ref VPC
|
| 32 |
+
InternetGatewayId: !Ref InternetGateway
|
| 33 |
+
|
| 34 |
+
PublicSubnet1:
|
| 35 |
+
Type: AWS::EC2::Subnet
|
| 36 |
+
Properties:
|
| 37 |
+
VpcId: !Ref VPC
|
| 38 |
+
CidrBlock: 10.0.1.0/24
|
| 39 |
+
AvailabilityZone: !Select [ 0, !GetAZs '' ]
|
| 40 |
+
MapPublicIpOnLaunch: true
|
| 41 |
+
Tags:
|
| 42 |
+
- Key: Name
|
| 43 |
+
Value: Redis-Public-Subnet-1
|
| 44 |
+
|
| 45 |
+
PublicSubnet2:
|
| 46 |
+
Type: AWS::EC2::Subnet
|
| 47 |
+
Properties:
|
| 48 |
+
VpcId: !Ref VPC
|
| 49 |
+
CidrBlock: 10.0.2.0/24
|
| 50 |
+
AvailabilityZone: !Select [ 1, !GetAZs '' ]
|
| 51 |
+
MapPublicIpOnLaunch: true
|
| 52 |
+
Tags:
|
| 53 |
+
- Key: Name
|
| 54 |
+
Value: Redis-Public-Subnet-2
|
| 55 |
+
|
| 56 |
+
PublicRouteTable:
|
| 57 |
+
Type: AWS::EC2::RouteTable
|
| 58 |
+
Properties:
|
| 59 |
+
VpcId: !Ref VPC
|
| 60 |
+
|
| 61 |
+
PublicRoute:
|
| 62 |
+
Type: AWS::EC2::Route
|
| 63 |
+
DependsOn: VPCGatewayAttachment
|
| 64 |
+
Properties:
|
| 65 |
+
RouteTableId: !Ref PublicRouteTable
|
| 66 |
+
DestinationCidrBlock: 0.0.0.0/0
|
| 67 |
+
GatewayId: !Ref InternetGateway
|
| 68 |
+
|
| 69 |
+
PublicSubnet1RouteTableAssociation:
|
| 70 |
+
Type: AWS::EC2::SubnetRouteTableAssociation
|
| 71 |
+
Properties:
|
| 72 |
+
SubnetId: !Ref PublicSubnet1
|
| 73 |
+
RouteTableId: !Ref PublicRouteTable
|
| 74 |
+
|
| 75 |
+
PublicSubnet2RouteTableAssociation:
|
| 76 |
+
Type: AWS::EC2::SubnetRouteTableAssociation
|
| 77 |
+
Properties:
|
| 78 |
+
SubnetId: !Ref PublicSubnet2
|
| 79 |
+
RouteTableId: !Ref PublicRouteTable
|
| 80 |
+
|
| 81 |
+
ProxySecurityGroup:
|
| 82 |
+
Type: AWS::EC2::SecurityGroup
|
| 83 |
+
Properties:
|
| 84 |
+
GroupDescription: Allow public access to Redis port via Proxy
|
| 85 |
+
VpcId: !Ref VPC
|
| 86 |
+
SecurityGroupIngress:
|
| 87 |
+
- IpProtocol: tcp
|
| 88 |
+
FromPort: 6379
|
| 89 |
+
ToPort: 6379
|
| 90 |
+
CidrIp: 0.0.0.0/0
|
| 91 |
+
- IpProtocol: tcp
|
| 92 |
+
FromPort: 22
|
| 93 |
+
ToPort: 22
|
| 94 |
+
CidrIp: 0.0.0.0/0
|
| 95 |
+
|
| 96 |
+
RedisSecurityGroup:
|
| 97 |
+
Type: AWS::EC2::SecurityGroup
|
| 98 |
+
Properties:
|
| 99 |
+
GroupDescription: Allow access from Proxy to ElastiCache
|
| 100 |
+
VpcId: !Ref VPC
|
| 101 |
+
SecurityGroupIngress:
|
| 102 |
+
- IpProtocol: tcp
|
| 103 |
+
FromPort: 6379
|
| 104 |
+
ToPort: 6379
|
| 105 |
+
SourceSecurityGroupId: !Ref ProxySecurityGroup
|
| 106 |
+
|
| 107 |
+
RedisSubnetGroup:
|
| 108 |
+
Type: AWS::ElastiCache::SubnetGroup
|
| 109 |
+
Properties:
|
| 110 |
+
Description: Subnet group for Redis cluster
|
| 111 |
+
SubnetIds:
|
| 112 |
+
- !Ref PublicSubnet1
|
| 113 |
+
- !Ref PublicSubnet2
|
| 114 |
+
|
| 115 |
+
RedisCluster:
|
| 116 |
+
Type: AWS::ElastiCache::CacheCluster
|
| 117 |
+
Properties:
|
| 118 |
+
Engine: redis
|
| 119 |
+
CacheNodeType: !Ref CacheNodeType
|
| 120 |
+
NumCacheNodes: 1
|
| 121 |
+
CacheSubnetGroupName: !Ref RedisSubnetGroup
|
| 122 |
+
VpcSecurityGroupIds:
|
| 123 |
+
- !Ref RedisSecurityGroup
|
| 124 |
+
|
| 125 |
+
ProxyInstance:
|
| 126 |
+
Type: AWS::EC2::Instance
|
| 127 |
+
DependsOn: VPCGatewayAttachment
|
| 128 |
+
Properties:
|
| 129 |
+
InstanceType: !Ref ProxyInstanceType
|
| 130 |
+
ImageId: '{{resolve:ssm:/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-6.1-x86_64}}'
|
| 131 |
+
SubnetId: !Ref PublicSubnet1
|
| 132 |
+
SecurityGroupIds:
|
| 133 |
+
- !Ref ProxySecurityGroup
|
| 134 |
+
UserData:
|
| 135 |
+
Fn::Base64: !Sub |
|
| 136 |
+
#!/bin/bash
|
| 137 |
+
dnf install -y haproxy
|
| 138 |
+
cat <<EOF > /etc/haproxy/haproxy.cfg
|
| 139 |
+
global
|
| 140 |
+
log /dev/log local0
|
| 141 |
+
log /dev/log local1 notice
|
| 142 |
+
chroot /var/lib/haproxy
|
| 143 |
+
pidfile /var/run/haproxy.pid
|
| 144 |
+
maxconn 4000
|
| 145 |
+
user haproxy
|
| 146 |
+
group haproxy
|
| 147 |
+
daemon
|
| 148 |
+
defaults
|
| 149 |
+
log global
|
| 150 |
+
mode tcp
|
| 151 |
+
option tcplog
|
| 152 |
+
option dontlognull
|
| 153 |
+
timeout connect 5000
|
| 154 |
+
timeout client 50000
|
| 155 |
+
timeout server 50000
|
| 156 |
+
frontend redis_frontend
|
| 157 |
+
bind *:6379
|
| 158 |
+
default_backend redis_backend
|
| 159 |
+
backend redis_backend
|
| 160 |
+
server redis_server ${RedisCluster.RedisEndpoint.Address}:${RedisCluster.RedisEndpoint.Port} check
|
| 161 |
+
EOF
|
| 162 |
+
systemctl enable haproxy
|
| 163 |
+
systemctl restart haproxy
|
| 164 |
+
|
| 165 |
+
ProxyEIP:
|
| 166 |
+
Type: AWS::EC2::EIP
|
| 167 |
+
Properties:
|
| 168 |
+
Domain: vpc
|
| 169 |
+
InstanceId: !Ref ProxyInstance
|
| 170 |
+
|
| 171 |
+
Outputs:
|
| 172 |
+
PublicRedisEndpoint:
|
| 173 |
+
Description: Public IP address to connect to the Redis cluster
|
| 174 |
+
Value: !Ref ProxyEIP
|
| 175 |
+
PublicRedisPort:
|
| 176 |
+
Description: Port to connect to the Redis cluster
|
| 177 |
+
Value: '6379'
|
| 178 |
+
PublicRedisConnectionCommand:
|
| 179 |
+
Description: Example command to connect using redis-cli
|
| 180 |
+
Value: !Sub 'redis-cli -h ${ProxyEIP} -p 6379'
|
generated/simple/gemini-3.1-pro/aws-cfn-008/main.yaml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: Provision an SNS topic allowing everyone to publish.
|
| 3 |
+
|
| 4 |
+
Resources:
|
| 5 |
+
PublicSNSTopic:
|
| 6 |
+
Type: AWS::SNS::Topic
|
| 7 |
+
Properties:
|
| 8 |
+
TopicName: PublicPublishTopic
|
| 9 |
+
|
| 10 |
+
PublicSNSTopicPolicy:
|
| 11 |
+
Type: AWS::SNS::TopicPolicy
|
| 12 |
+
Properties:
|
| 13 |
+
Topics:
|
| 14 |
+
- !Ref PublicSNSTopic
|
| 15 |
+
PolicyDocument:
|
| 16 |
+
Version: '2012-10-17'
|
| 17 |
+
Statement:
|
| 18 |
+
- Sid: AllowPublicPublish
|
| 19 |
+
Effect: Allow
|
| 20 |
+
Principal: '*'
|
| 21 |
+
Action: sns:Publish
|
| 22 |
+
Resource: !Ref PublicSNSTopic
|
| 23 |
+
|
| 24 |
+
Outputs:
|
| 25 |
+
TopicArn:
|
| 26 |
+
Description: ARN of the public SNS Topic
|
| 27 |
+
Value: !Ref PublicSNSTopic
|
generated/simple/gemini-3.1-pro/aws-cfn-009/main.yaml
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'Production-ready ECS Fargate Cluster with an Application Load Balancer and a Web Service.'
|
| 3 |
+
|
| 4 |
+
Parameters:
|
| 5 |
+
VpcCidr:
|
| 6 |
+
Type: String
|
| 7 |
+
Default: '10.0.0.0/16'
|
| 8 |
+
Description: CIDR block for the VPC
|
| 9 |
+
PublicSubnet1Cidr:
|
| 10 |
+
Type: String
|
| 11 |
+
Default: '10.0.1.0/24'
|
| 12 |
+
Description: CIDR block for Public Subnet 1
|
| 13 |
+
PublicSubnet2Cidr:
|
| 14 |
+
Type: String
|
| 15 |
+
Default: '10.0.2.0/24'
|
| 16 |
+
Description: CIDR block for Public Subnet 2
|
| 17 |
+
ContainerImage:
|
| 18 |
+
Type: String
|
| 19 |
+
Default: 'nginx:latest'
|
| 20 |
+
Description: Docker image to run in the ECS cluster
|
| 21 |
+
ContainerPort:
|
| 22 |
+
Type: Number
|
| 23 |
+
Default: 80
|
| 24 |
+
Description: Port the container listens on
|
| 25 |
+
DesiredCount:
|
| 26 |
+
Type: Number
|
| 27 |
+
Default: 2
|
| 28 |
+
Description: Number of Fargate tasks to run
|
| 29 |
+
TaskCpu:
|
| 30 |
+
Type: String
|
| 31 |
+
Default: '256'
|
| 32 |
+
Description: CPU units for the Fargate task
|
| 33 |
+
TaskMemory:
|
| 34 |
+
Type: String
|
| 35 |
+
Default: '512'
|
| 36 |
+
Description: Memory (MB) for the Fargate task
|
| 37 |
+
|
| 38 |
+
Resources:
|
| 39 |
+
# Network Infrastructure
|
| 40 |
+
VPC:
|
| 41 |
+
Type: AWS::EC2::VPC
|
| 42 |
+
Properties:
|
| 43 |
+
CidrBlock: !Ref VpcCidr
|
| 44 |
+
EnableDnsSupport: true
|
| 45 |
+
EnableDnsHostnames: true
|
| 46 |
+
Tags:
|
| 47 |
+
- Key: Name
|
| 48 |
+
Value: !Sub '${AWS::StackName}-vpc'
|
| 49 |
+
|
| 50 |
+
InternetGateway:
|
| 51 |
+
Type: AWS::EC2::InternetGateway
|
| 52 |
+
Properties:
|
| 53 |
+
Tags:
|
| 54 |
+
- Key: Name
|
| 55 |
+
Value: !Sub '${AWS::StackName}-igw'
|
| 56 |
+
|
| 57 |
+
VPCGatewayAttachment:
|
| 58 |
+
Type: AWS::EC2::VPCGatewayAttachment
|
| 59 |
+
Properties:
|
| 60 |
+
VpcId: !Ref VPC
|
| 61 |
+
InternetGatewayId: !Ref InternetGateway
|
| 62 |
+
|
| 63 |
+
PublicSubnet1:
|
| 64 |
+
Type: AWS::EC2::Subnet
|
| 65 |
+
Properties:
|
| 66 |
+
VpcId: !Ref VPC
|
| 67 |
+
CidrBlock: !Ref PublicSubnet1Cidr
|
| 68 |
+
AvailabilityZone: !Select [0, !GetAZs '']
|
| 69 |
+
MapPublicIpOnLaunch: true
|
| 70 |
+
Tags:
|
| 71 |
+
- Key: Name
|
| 72 |
+
Value: !Sub '${AWS::StackName}-public-subnet-1'
|
| 73 |
+
|
| 74 |
+
PublicSubnet2:
|
| 75 |
+
Type: AWS::EC2::Subnet
|
| 76 |
+
Properties:
|
| 77 |
+
VpcId: !Ref VPC
|
| 78 |
+
CidrBlock: !Ref PublicSubnet2Cidr
|
| 79 |
+
AvailabilityZone: !Select [1, !GetAZs '']
|
| 80 |
+
MapPublicIpOnLaunch: true
|
| 81 |
+
Tags:
|
| 82 |
+
- Key: Name
|
| 83 |
+
Value: !Sub '${AWS::StackName}-public-subnet-2'
|
| 84 |
+
|
| 85 |
+
PublicRouteTable:
|
| 86 |
+
Type: AWS::EC2::RouteTable
|
| 87 |
+
Properties:
|
| 88 |
+
VpcId: !Ref VPC
|
| 89 |
+
Tags:
|
| 90 |
+
- Key: Name
|
| 91 |
+
Value: !Sub '${AWS::StackName}-public-rt'
|
| 92 |
+
|
| 93 |
+
PublicRoute:
|
| 94 |
+
Type: AWS::EC2::Route
|
| 95 |
+
DependsOn: VPCGatewayAttachment
|
| 96 |
+
Properties:
|
| 97 |
+
RouteTableId: !Ref PublicRouteTable
|
| 98 |
+
DestinationCidrBlock: '0.0.0.0/0'
|
| 99 |
+
GatewayId: !Ref InternetGateway
|
| 100 |
+
|
| 101 |
+
PublicSubnet1RouteTableAssociation:
|
| 102 |
+
Type: AWS::EC2::SubnetRouteTableAssociation
|
| 103 |
+
Properties:
|
| 104 |
+
SubnetId: !Ref PublicSubnet1
|
| 105 |
+
RouteTableId: !Ref PublicRouteTable
|
| 106 |
+
|
| 107 |
+
PublicSubnet2RouteTableAssociation:
|
| 108 |
+
Type: AWS::EC2::SubnetRouteTableAssociation
|
| 109 |
+
Properties:
|
| 110 |
+
SubnetId: !Ref PublicSubnet2
|
| 111 |
+
RouteTableId: !Ref PublicRouteTable
|
| 112 |
+
|
| 113 |
+
# Security Groups
|
| 114 |
+
ALBSecurityGroup:
|
| 115 |
+
Type: AWS::EC2::SecurityGroup
|
| 116 |
+
Properties:
|
| 117 |
+
GroupDescription: Allow HTTP traffic to ALB
|
| 118 |
+
VpcId: !Ref VPC
|
| 119 |
+
SecurityGroupIngress:
|
| 120 |
+
- IpProtocol: tcp
|
| 121 |
+
FromPort: 80
|
| 122 |
+
ToPort: 80
|
| 123 |
+
CidrIp: '0.0.0.0/0'
|
| 124 |
+
Tags:
|
| 125 |
+
- Key: Name
|
| 126 |
+
Value: !Sub '${AWS::StackName}-alb-sg'
|
| 127 |
+
|
| 128 |
+
FargateSecurityGroup:
|
| 129 |
+
Type: AWS::EC2::SecurityGroup
|
| 130 |
+
Properties:
|
| 131 |
+
GroupDescription: Allow traffic from ALB to Fargate tasks
|
| 132 |
+
VpcId: !Ref VPC
|
| 133 |
+
SecurityGroupIngress:
|
| 134 |
+
- IpProtocol: tcp
|
| 135 |
+
FromPort: !Ref ContainerPort
|
| 136 |
+
ToPort: !Ref ContainerPort
|
| 137 |
+
SourceSecurityGroupId: !Ref ALBSecurityGroup
|
| 138 |
+
Tags:
|
| 139 |
+
- Key: Name
|
| 140 |
+
Value: !Sub '${AWS::StackName}-fargate-sg'
|
| 141 |
+
|
| 142 |
+
# Application Load Balancer
|
| 143 |
+
ApplicationLoadBalancer:
|
| 144 |
+
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
|
| 145 |
+
Properties:
|
| 146 |
+
Name: !Sub '${AWS::StackName}-alb'
|
| 147 |
+
Scheme: internet-facing
|
| 148 |
+
Subnets:
|
| 149 |
+
- !Ref PublicSubnet1
|
| 150 |
+
- !Ref PublicSubnet2
|
| 151 |
+
- !Ref PublicSubnet3
|
| 152 |
+
SecurityGroups:
|
| 153 |
+
- !Ref ALBSecurityGroup
|
| 154 |
+
Type: application
|
| 155 |
+
|
| 156 |
+
ALBTargetGroup:
|
| 157 |
+
Type: AWS::ElasticLoadBalancingV2::TargetGroup
|
| 158 |
+
Properties:
|
| 159 |
+
Name: !Sub '${AWS::StackName}-tg'
|
| 160 |
+
VpcId: !Ref VPC
|
| 161 |
+
Port: !Ref ContainerPort
|
| 162 |
+
Protocol: HTTP
|
| 163 |
+
TargetType: ip
|
| 164 |
+
HealthCheckIntervalSeconds: 30
|
| 165 |
+
HealthCheckPath: '/'
|
| 166 |
+
HealthCheckProtocol: HTTP
|
| 167 |
+
HealthCheckTimeoutSeconds: 5
|
| 168 |
+
HealthyThresholdCount: 2
|
| 169 |
+
UnhealthyThresholdCount: 3
|
| 170 |
+
|
| 171 |
+
ALBListener:
|
| 172 |
+
Type: AWS::ElasticLoadBalancingV2::Listener
|
| 173 |
+
Properties:
|
| 174 |
+
LoadBalancerArn: !Ref ApplicationLoadBalancer
|
| 175 |
+
Port: 80
|
| 176 |
+
Protocol: HTTP
|
| 177 |
+
DefaultActions:
|
| 178 |
+
- Type: forward
|
| 179 |
+
TargetGroupArn: !Ref ALBTargetGroup
|
| 180 |
+
|
| 181 |
+
# ECS Cluster & IAM
|
| 182 |
+
ECSCluster:
|
| 183 |
+
Type: AWS::ECS::Cluster
|
| 184 |
+
Properties:
|
| 185 |
+
ClusterName: !Sub '${AWS::StackName}-cluster'
|
| 186 |
+
CapacityProviders:
|
| 187 |
+
- FARGATE
|
| 188 |
+
- FARGATE_SPOT
|
| 189 |
+
DefaultCapacityProviderStrategy:
|
| 190 |
+
- CapacityProvider: FARGATE
|
| 191 |
+
Weight: 1
|
| 192 |
+
|
| 193 |
+
ECSTaskExecutionRole:
|
| 194 |
+
Type: AWS::IAM::Role
|
| 195 |
+
Properties:
|
| 196 |
+
AssumeRolePolicyDocument:
|
| 197 |
+
Version: '2012-10-17'
|
| 198 |
+
Statement:
|
| 199 |
+
- Effect: Allow
|
| 200 |
+
Principal:
|
| 201 |
+
Service: ecs-tasks.amazonaws.com
|
| 202 |
+
Action: sts:AssumeRole
|
| 203 |
+
ManagedPolicyArns:
|
| 204 |
+
- arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
|
| 205 |
+
|
| 206 |
+
CloudWatchLogGroup:
|
| 207 |
+
Type: AWS::Logs::LogGroup
|
| 208 |
+
Properties:
|
| 209 |
+
LogGroupName: !Sub '/ecs/${AWS::StackName}-web-app'
|
| 210 |
+
RetentionInDays: 14
|
| 211 |
+
|
| 212 |
+
# ECS Task Definition & Service
|
| 213 |
+
TaskDefinition:
|
| 214 |
+
Type: AWS::ECS::TaskDefinition
|
| 215 |
+
Properties:
|
| 216 |
+
Family: !Sub '${AWS::StackName}-web-task'
|
| 217 |
+
NetworkMode: awsvpc
|
| 218 |
+
RequiresCompatibilities:
|
| 219 |
+
- FARGATE
|
| 220 |
+
Cpu: !Ref TaskCpu
|
| 221 |
+
Memory: !Ref TaskMemory
|
| 222 |
+
ExecutionRoleArn: !GetAtt ECSTaskExecutionRole.Arn
|
| 223 |
+
ContainerDefinitions:
|
| 224 |
+
- Name: web-app
|
| 225 |
+
Image: !Ref ContainerImage
|
| 226 |
+
PortMappings:
|
| 227 |
+
- ContainerPort: !Ref ContainerPort
|
| 228 |
+
Protocol: tcp
|
| 229 |
+
LogConfiguration:
|
| 230 |
+
LogDriver: awslogs
|
| 231 |
+
Options:
|
| 232 |
+
awslogs-group: !Ref CloudWatchLogGroup
|
| 233 |
+
awslogs-region: !Ref AWS::Region
|
| 234 |
+
awslogs-stream-prefix: ecs
|
| 235 |
+
|
| 236 |
+
FargateService:
|
| 237 |
+
Type: AWS::ECS::Service
|
| 238 |
+
DependsOn: ALBListener
|
| 239 |
+
Properties:
|
| 240 |
+
ServiceName: !Sub '${AWS::StackName}-service'
|
| 241 |
+
Cluster: !Ref ECSCluster
|
| 242 |
+
TaskDefinition: !Ref TaskDefinition
|
| 243 |
+
DesiredCount: !Ref DesiredCount
|
| 244 |
+
LaunchType: FARGATE
|
| 245 |
+
NetworkConfiguration:
|
| 246 |
+
AwsvpcConfiguration:
|
| 247 |
+
AssignPublicIp: ENABLED
|
| 248 |
+
SecurityGroups:
|
| 249 |
+
- !Ref FargateSecurityGroup
|
| 250 |
+
Subnets:
|
| 251 |
+
- !Ref PublicSubnet1
|
| 252 |
+
- !Ref PublicSubnet2
|
| 253 |
+
LoadBalancers:
|
| 254 |
+
- ContainerName: web-app
|
| 255 |
+
ContainerPort: !Ref ContainerPort
|
| 256 |
+
TargetGroupArn: !Ref ALBTargetGroup
|
| 257 |
+
|
| 258 |
+
Outputs:
|
| 259 |
+
WebAppUrl:
|
| 260 |
+
Description: URL of the Application Load Balancer
|
| 261 |
+
Value: !Sub 'http://${ApplicationLoadBalancer.DNSName}'
|
| 262 |
+
EcsClusterName:
|
| 263 |
+
Description: Name of the ECS Cluster
|
| 264 |
+
Value: !Ref ECSCluster
|
generated/simple/gemini-3.1-pro/aws-cfn-010/main.yaml
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
AWSTemplateFormatVersion: '2010-09-09'
|
| 2 |
+
Description: 'API Gateway REST API with a single endpoint and no authorization'
|
| 3 |
+
|
| 4 |
+
Resources:
|
| 5 |
+
PublicRestApi:
|
| 6 |
+
Type: AWS::ApiGateway::RestApi
|
| 7 |
+
Properties:
|
| 8 |
+
Name: PublicApi
|
| 9 |
+
Description: A public API Gateway without authorization
|
| 10 |
+
EndpointConfiguration:
|
| 11 |
+
Types:
|
| 12 |
+
- REGIONAL
|
| 13 |
+
|
| 14 |
+
ApiResource:
|
| 15 |
+
Type: AWS::ApiGateway::Resource
|
| 16 |
+
Properties:
|
| 17 |
+
RestApiId: !Ref PublicRestApi
|
| 18 |
+
ParentId: !GetAtt PublicRestApi.RootResourceId
|
| 19 |
+
PathPart: public-endpoint
|
| 20 |
+
|
| 21 |
+
ApiMethod:
|
| 22 |
+
Type: AWS::ApiGateway::Method
|
| 23 |
+
Properties:
|
| 24 |
+
RestApiId: !Ref PublicRestApi
|
| 25 |
+
ResourceId: !Ref ApiResource
|
| 26 |
+
HttpMethod: GET
|
| 27 |
+
AuthorizationType: NONE
|
| 28 |
+
MethodResponses:
|
| 29 |
+
- StatusCode: '200'
|
| 30 |
+
ResponseModels:
|
| 31 |
+
application/json: Empty
|
| 32 |
+
Integration:
|
| 33 |
+
Type: MOCK
|
| 34 |
+
IntegrationResponses:
|
| 35 |
+
- StatusCode: '200'
|
| 36 |
+
ResponseTemplates:
|
| 37 |
+
application/json: '{"message": "Success! This is a public endpoint."}'
|
| 38 |
+
RequestTemplates:
|
| 39 |
+
application/json: '{"statusCode": 200}'
|
| 40 |
+
|
| 41 |
+
ApiDeployment:
|
| 42 |
+
Type: AWS::ApiGateway::Deployment
|
| 43 |
+
DependsOn:
|
| 44 |
+
- ApiMethod
|
| 45 |
+
Properties:
|
| 46 |
+
RestApiId: !Ref PublicRestApi
|
| 47 |
+
|
| 48 |
+
ApiStage:
|
| 49 |
+
Type: AWS::ApiGateway::Stage
|
| 50 |
+
Properties:
|
| 51 |
+
RestApiId: !Ref PublicRestApi
|
| 52 |
+
DeploymentId: !Ref ApiDeployment
|
| 53 |
+
StageName: prod
|
| 54 |
+
Description: Production Stage
|
| 55 |
+
|
| 56 |
+
Outputs:
|
| 57 |
+
ApiEndpointUrl:
|
| 58 |
+
Description: URL of the public API endpoint
|
| 59 |
+
Value: !Sub "https://${PublicRestApi}.execute-api.${AWS::Region}.amazonaws.com/prod/public-endpoint"
|
generated/simple/gemini-3.1-pro/aws-tf-001/main.tf
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
variable "bucket_name" {
|
| 2 |
+
type = string
|
| 3 |
+
description = "The name of the S3 bucket for website hosting"
|
| 4 |
+
default = "my-public-website-bucket-12345"
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
resource "aws_s3_bucket" "website" {
|
| 8 |
+
bucket = var.bucket_name
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
resource "aws_s3_bucket_ownership_controls" "website" {
|
| 12 |
+
bucket = aws_s3_bucket.website.id
|
| 13 |
+
|
| 14 |
+
rule {
|
| 15 |
+
object_ownership = "BucketOwnerEnforced"
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
resource "aws_s3_bucket_public_access_block" "website" {
|
| 20 |
+
bucket = aws_s3_bucket.website.id
|
| 21 |
+
|
| 22 |
+
block_public_acls = true
|
| 23 |
+
block_public_policy = false
|
| 24 |
+
ignore_public_acls = true
|
| 25 |
+
restrict_public_buckets = false
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
resource "aws_s3_bucket_website_configuration" "website" {
|
| 29 |
+
bucket = aws_s3_bucket.website.id
|
| 30 |
+
|
| 31 |
+
index_document {
|
| 32 |
+
suffix = "index.html"
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
error_document {
|
| 36 |
+
key = "error.html"
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
data "aws_iam_policy_document" "website_policy" {
|
| 41 |
+
statement {
|
| 42 |
+
sid = "PublicReadGetObject"
|
| 43 |
+
effect = "Allow"
|
| 44 |
+
|
| 45 |
+
principals {
|
| 46 |
+
type = "*"
|
| 47 |
+
identifiers = ["*"]
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
actions = ["s3:GetObject"]
|
| 51 |
+
resources = ["${aws_s3_bucket.website.arn}/*"]
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
resource "aws_s3_bucket_policy" "website" {
|
| 56 |
+
bucket = aws_s3_bucket.website.id
|
| 57 |
+
policy = data.aws_iam_policy_document.website_policy.json
|
| 58 |
+
|
| 59 |
+
depends_on = [
|
| 60 |
+
aws_s3_bucket_public_access_block.website
|
| 61 |
+
]
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
output "website_endpoint" {
|
| 65 |
+
value = aws_s3_bucket_website_configuration.website.website_endpoint
|
| 66 |
+
description = "The website endpoint URL"
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
output "website_domain" {
|
| 70 |
+
value = aws_s3_bucket_website_configuration.website.website_domain
|
| 71 |
+
description = "The domain of the website endpoint"
|
| 72 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-002/main.tf
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
variable "bucket_name" {
|
| 2 |
+
type = string
|
| 3 |
+
description = "The name of the S3 bucket for backups"
|
| 4 |
+
default = "production-backup-bucket-private"
|
| 5 |
+
}
|
| 6 |
+
|
| 7 |
+
variable "tags" {
|
| 8 |
+
type = map(string)
|
| 9 |
+
description = "Tags to apply to the S3 bucket"
|
| 10 |
+
default = {
|
| 11 |
+
Environment = "Production"
|
| 12 |
+
Purpose = "Backups"
|
| 13 |
+
ManagedBy = "Terraform"
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
resource "aws_s3_bucket" "backup" {
|
| 18 |
+
bucket = var.bucket_name
|
| 19 |
+
tags = var.tags
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
resource "aws_s3_bucket_versioning" "backup_versioning" {
|
| 23 |
+
bucket = aws_s3_bucket.backup.id
|
| 24 |
+
|
| 25 |
+
versioning_configuration {
|
| 26 |
+
status = "Enabled"
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
resource "aws_s3_bucket_public_access_block" "backup_public_access_block" {
|
| 31 |
+
bucket = aws_s3_bucket.backup.id
|
| 32 |
+
|
| 33 |
+
block_public_acls = true
|
| 34 |
+
block_public_policy = true
|
| 35 |
+
ignore_public_acls = true
|
| 36 |
+
restrict_public_buckets = true
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
resource "aws_s3_bucket_server_side_encryption_configuration" "backup_encryption" {
|
| 40 |
+
bucket = aws_s3_bucket.backup.id
|
| 41 |
+
|
| 42 |
+
rule {
|
| 43 |
+
apply_server_side_encryption_by_default {
|
| 44 |
+
sse_algorithm = "AES256"
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-003/main.tf
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_version = ">= 1.0.0"
|
| 3 |
+
required_providers {
|
| 4 |
+
aws = {
|
| 5 |
+
source = "hashicorp/aws"
|
| 6 |
+
version = "~> 5.0"
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
provider "aws" {
|
| 12 |
+
region = var.aws_region
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
variable "aws_region" {
|
| 16 |
+
type = string
|
| 17 |
+
description = "AWS region to deploy resources"
|
| 18 |
+
default = "us-east-1"
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
variable "instance_type" {
|
| 22 |
+
type = string
|
| 23 |
+
description = "EC2 instance type"
|
| 24 |
+
default = "t3.micro"
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
variable "ssh_allowed_cidr" {
|
| 28 |
+
type = string
|
| 29 |
+
description = "CIDR block allowed to connect via SSH"
|
| 30 |
+
default = "0.0.0.0/0"
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
data "aws_ami" "amazon_linux_2023" {
|
| 34 |
+
most_recent = true
|
| 35 |
+
owners = ["amazon"]
|
| 36 |
+
|
| 37 |
+
filter {
|
| 38 |
+
name = "name"
|
| 39 |
+
values = ["al2023-ami-2023.*-x86_64"]
|
| 40 |
+
}
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
resource "aws_vpc" "main" {
|
| 44 |
+
cidr_block = "10.0.0.0/16"
|
| 45 |
+
enable_dns_support = true
|
| 46 |
+
enable_dns_hostnames = true
|
| 47 |
+
|
| 48 |
+
tags = {
|
| 49 |
+
Name = "main-vpc"
|
| 50 |
+
}
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
resource "aws_internet_gateway" "igw" {
|
| 54 |
+
vpc_id = aws_vpc.main.id
|
| 55 |
+
|
| 56 |
+
tags = {
|
| 57 |
+
Name = "main-igw"
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
resource "aws_subnet" "public" {
|
| 62 |
+
vpc_id = aws_vpc.main.id
|
| 63 |
+
cidr_block = "10.0.1.0/24"
|
| 64 |
+
map_public_ip_on_launch = true
|
| 65 |
+
|
| 66 |
+
tags = {
|
| 67 |
+
Name = "public-subnet"
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
resource "aws_route_table" "public" {
|
| 72 |
+
vpc_id = aws_vpc.main.id
|
| 73 |
+
|
| 74 |
+
route {
|
| 75 |
+
cidr_block = "0.0.0.0/0"
|
| 76 |
+
gateway_id = aws_internet_gateway.igw.id
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
tags = {
|
| 80 |
+
Name = "public-route-table"
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
resource "aws_route_table_association" "public" {
|
| 85 |
+
subnet_id = aws_subnet.public.id
|
| 86 |
+
route_table_id = aws_route_table.public.id
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
resource "aws_security_group" "ssh_access" {
|
| 90 |
+
name = "allow_ssh"
|
| 91 |
+
description = "Allow SSH inbound traffic and all outbound traffic"
|
| 92 |
+
vpc_id = aws_vpc.main.id
|
| 93 |
+
|
| 94 |
+
tags = {
|
| 95 |
+
Name = "allow-ssh-sg"
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
resource "aws_vpc_security_group_ingress_rule" "allow_ssh_ipv4" {
|
| 100 |
+
security_group_id = aws_security_group.ssh_access.id
|
| 101 |
+
cidr_ipv4 = var.ssh_allowed_cidr
|
| 102 |
+
from_port = 22
|
| 103 |
+
ip_protocol = "tcp"
|
| 104 |
+
to_port = 22
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
resource "aws_vpc_security_group_egress_rule" "allow_all_traffic_ipv4" {
|
| 108 |
+
security_group_id = aws_security_group.ssh_access.id
|
| 109 |
+
cidr_ipv4 = "0.0.0.0/0"
|
| 110 |
+
ip_protocol = "-1"
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
resource "aws_instance" "server" {
|
| 114 |
+
ami = data.aws_ami.amazon_linux_2023.id
|
| 115 |
+
instance_type = var.instance_type
|
| 116 |
+
subnet_id = aws_subnet.public.id
|
| 117 |
+
vpc_security_group_ids = [aws_security_group.ssh_access.id]
|
| 118 |
+
|
| 119 |
+
root_block_device {
|
| 120 |
+
volume_size = 20
|
| 121 |
+
volume_type = "gp3"
|
| 122 |
+
encrypted = true
|
| 123 |
+
delete_on_termination = true
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
tags = {
|
| 127 |
+
Name = "public-ec2-instance"
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
output "instance_id" {
|
| 132 |
+
description = "The ID of the EC2 instance"
|
| 133 |
+
value = aws_instance.server.id
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
output "instance_public_ip" {
|
| 137 |
+
description = "The public IP address of the EC2 instance"
|
| 138 |
+
value = aws_instance.server.public_ip
|
| 139 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-004/main.tf
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
aws = {
|
| 4 |
+
source = "hashicorp/aws"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "aws" {
|
| 11 |
+
region = "us-east-1"
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
data "aws_availability_zones" "available" {
|
| 15 |
+
state = "available"
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
data "aws_ami" "amazon_linux_2023" {
|
| 19 |
+
most_recent = true
|
| 20 |
+
owners = ["amazon"]
|
| 21 |
+
|
| 22 |
+
filter {
|
| 23 |
+
name = "name"
|
| 24 |
+
values = ["al2023-ami-2023.*-x86_64"]
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
# --- VPC & Networking ---
|
| 29 |
+
|
| 30 |
+
resource "aws_vpc" "main" {
|
| 31 |
+
cidr_block = "10.0.0.0/16"
|
| 32 |
+
enable_dns_hostnames = true
|
| 33 |
+
enable_dns_support = true
|
| 34 |
+
|
| 35 |
+
tags = {
|
| 36 |
+
Name = "main-vpc"
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
resource "aws_subnet" "public" {
|
| 41 |
+
count = 2
|
| 42 |
+
vpc_id = aws_vpc.main.id
|
| 43 |
+
cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 8, count.index)
|
| 44 |
+
availability_zone = data.aws_availability_zones.available.names[count.index]
|
| 45 |
+
map_public_ip_on_launch = true
|
| 46 |
+
|
| 47 |
+
tags = {
|
| 48 |
+
Name = "public-subnet-${count.index + 1}"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
resource "aws_subnet" "private" {
|
| 53 |
+
count = 2
|
| 54 |
+
vpc_id = aws_vpc.main.id
|
| 55 |
+
cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 8, count.index + 2)
|
| 56 |
+
availability_zone = data.aws_availability_zones.available.names[count.index]
|
| 57 |
+
|
| 58 |
+
tags = {
|
| 59 |
+
Name = "private-subnet-${count.index + 1}"
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
resource "aws_internet_gateway" "igw" {
|
| 64 |
+
vpc_id = aws_vpc.main.id
|
| 65 |
+
|
| 66 |
+
tags = {
|
| 67 |
+
Name = "main-igw"
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
resource "aws_eip" "nat" {
|
| 72 |
+
domain = "vpc"
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
resource "aws_nat_gateway" "nat" {
|
| 76 |
+
allocation_id = aws_eip.nat.id
|
| 77 |
+
subnet_id = aws_subnet.public[0].id
|
| 78 |
+
|
| 79 |
+
tags = {
|
| 80 |
+
Name = "main-nat"
|
| 81 |
+
}
|
| 82 |
+
depends_on = [aws_internet_gateway.igw]
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
resource "aws_route_table" "public" {
|
| 86 |
+
vpc_id = aws_vpc.main.id
|
| 87 |
+
|
| 88 |
+
route {
|
| 89 |
+
cidr_block = "0.0.0.0/0"
|
| 90 |
+
gateway_id = aws_internet_gateway.igw.id
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
tags = {
|
| 94 |
+
Name = "public-rt"
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
resource "aws_route_table_association" "public" {
|
| 99 |
+
count = 2
|
| 100 |
+
subnet_id = aws_subnet.public[count.index].id
|
| 101 |
+
route_table_id = aws_route_table.public.id
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
resource "aws_route_table" "private" {
|
| 105 |
+
vpc_id = aws_vpc.main.id
|
| 106 |
+
|
| 107 |
+
route {
|
| 108 |
+
cidr_block = "0.0.0.0/0"
|
| 109 |
+
nat_gateway_id = aws_nat_gateway.nat.id
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
tags = {
|
| 113 |
+
Name = "private-rt"
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
resource "aws_route_table_association" "private" {
|
| 118 |
+
count = 2
|
| 119 |
+
subnet_id = aws_subnet.private[count.index].id
|
| 120 |
+
route_table_id = aws_route_table.private.id
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
# --- Security Groups ---
|
| 124 |
+
|
| 125 |
+
resource "aws_security_group" "alb_sg" {
|
| 126 |
+
name = "alb-sg"
|
| 127 |
+
description = "Allow HTTP inbound traffic to ALB"
|
| 128 |
+
vpc_id = aws_vpc.main.id
|
| 129 |
+
|
| 130 |
+
ingress {
|
| 131 |
+
description = "HTTP from anywhere"
|
| 132 |
+
from_port = 80
|
| 133 |
+
to_port = 80
|
| 134 |
+
protocol = "tcp"
|
| 135 |
+
cidr_blocks = ["0.0.0.0/0"]
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
egress {
|
| 139 |
+
from_port = 0
|
| 140 |
+
to_port = 0
|
| 141 |
+
protocol = "-1"
|
| 142 |
+
cidr_blocks = ["0.0.0.0/0"]
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
tags = {
|
| 146 |
+
Name = "alb-sg"
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
resource "aws_security_group" "app_sg" {
|
| 151 |
+
name = "app-sg"
|
| 152 |
+
description = "Allow HTTP inbound traffic from ALB"
|
| 153 |
+
vpc_id = aws_vpc.main.id
|
| 154 |
+
|
| 155 |
+
ingress {
|
| 156 |
+
description = "HTTP from ALB"
|
| 157 |
+
from_port = 80
|
| 158 |
+
to_port = 80
|
| 159 |
+
protocol = "tcp"
|
| 160 |
+
security_groups = [aws_security_group.alb_sg.id]
|
| 161 |
+
}
|
| 162 |
+
|
| 163 |
+
egress {
|
| 164 |
+
from_port = 0
|
| 165 |
+
to_port = 0
|
| 166 |
+
protocol = "-1"
|
| 167 |
+
cidr_blocks = ["0.0.0.0/0"]
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
tags = {
|
| 171 |
+
Name = "app-sg"
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
# --- Application Load Balancer ---
|
| 176 |
+
|
| 177 |
+
resource "aws_lb" "app_alb" {
|
| 178 |
+
name = "app-alb"
|
| 179 |
+
internal = false
|
| 180 |
+
load_balancer_type = "application"
|
| 181 |
+
security_groups = [aws_security_group.alb_sg.id]
|
| 182 |
+
subnets = aws_subnet.public[*].id
|
| 183 |
+
|
| 184 |
+
enable_deletion_protection = false
|
| 185 |
+
|
| 186 |
+
tags = {
|
| 187 |
+
Name = "app-alb"
|
| 188 |
+
}
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
resource "aws_lb_target_group" "app_tg" {
|
| 192 |
+
name = "app-tg"
|
| 193 |
+
port = 80
|
| 194 |
+
protocol = "HTTP"
|
| 195 |
+
vpc_id = aws_vpc.main.id
|
| 196 |
+
|
| 197 |
+
health_check {
|
| 198 |
+
path = "/"
|
| 199 |
+
healthy_threshold = 2
|
| 200 |
+
unhealthy_threshold = 5
|
| 201 |
+
timeout = 5
|
| 202 |
+
interval = 30
|
| 203 |
+
matcher = "200"
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
tags = {
|
| 207 |
+
Name = "app-tg"
|
| 208 |
+
}
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
resource "aws_lb_listener" "http" {
|
| 212 |
+
load_balancer_arn = aws_lb.app_alb.arn
|
| 213 |
+
port = "80"
|
| 214 |
+
protocol = "HTTP"
|
| 215 |
+
|
| 216 |
+
default_action {
|
| 217 |
+
type = "forward"
|
| 218 |
+
target_group_arn = aws_lb_target_group.app_tg.arn
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
# --- Launch Template & Auto Scaling Group ---
|
| 223 |
+
|
| 224 |
+
resource "aws_launch_template" "app_lt" {
|
| 225 |
+
name_prefix = "app-lt-"
|
| 226 |
+
image_id = data.aws_ami.amazon_linux_2023.id
|
| 227 |
+
instance_type = "t3.micro"
|
| 228 |
+
|
| 229 |
+
network_interfaces {
|
| 230 |
+
associate_public_ip_address = false
|
| 231 |
+
security_groups = [aws_security_group.app_sg.id]
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
user_data = base64encode(<<-EOF
|
| 235 |
+
#!/bin/bash
|
| 236 |
+
dnf update -y
|
| 237 |
+
dnf install -y httpd
|
| 238 |
+
systemctl start httpd
|
| 239 |
+
systemctl enable httpd
|
| 240 |
+
echo "<h1>Hello from ASG Instance</h1>" > /var/www/html/index.html
|
| 241 |
+
EOF
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
lifecycle {
|
| 245 |
+
create_before_destroy = true
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
tags = {
|
| 249 |
+
Name = "app-launch-template"
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
resource "aws_autoscaling_group" "app_asg" {
|
| 254 |
+
name = "app-asg"
|
| 255 |
+
vpc_zone_identifier = aws_subnet.private[*].id
|
| 256 |
+
target_group_arns = [aws_lb_target_group.app_tg.arn]
|
| 257 |
+
health_check_type = "ELB"
|
| 258 |
+
health_check_grace_period = 300
|
| 259 |
+
|
| 260 |
+
min_size = 2
|
| 261 |
+
max_size = 4
|
| 262 |
+
desired_capacity = 2
|
| 263 |
+
|
| 264 |
+
launch_template {
|
| 265 |
+
id = aws_launch_template.app_lt.id
|
| 266 |
+
version = "$Latest"
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
tag {
|
| 270 |
+
key = "Name"
|
| 271 |
+
value = "app-asg-instance"
|
| 272 |
+
propagate_at_launch = true
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
lifecycle {
|
| 276 |
+
create_before_destroy = true
|
| 277 |
+
}
|
| 278 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-005/main.tf
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
aws = {
|
| 4 |
+
source = "hashicorp/aws"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "aws" {
|
| 11 |
+
region = var.aws_region
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
variable "aws_region" {
|
| 15 |
+
type = string
|
| 16 |
+
description = "AWS region to deploy resources"
|
| 17 |
+
default = "us-east-1"
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
variable "db_username" {
|
| 21 |
+
type = string
|
| 22 |
+
description = "Database administrator username"
|
| 23 |
+
default = "postgres_admin"
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
variable "db_password" {
|
| 27 |
+
type = string
|
| 28 |
+
description = "Database administrator password"
|
| 29 |
+
sensitive = true
|
| 30 |
+
default = "SuperSecretPassword123!"
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
data "aws_availability_zones" "available" {
|
| 34 |
+
state = "available"
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
resource "aws_vpc" "rds_vpc" {
|
| 38 |
+
cidr_block = "10.0.0.0/16"
|
| 39 |
+
enable_dns_support = true
|
| 40 |
+
enable_dns_hostnames = true
|
| 41 |
+
|
| 42 |
+
tags = {
|
| 43 |
+
Name = "rds-public-vpc"
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
resource "aws_internet_gateway" "igw" {
|
| 48 |
+
vpc_id = aws_vpc.rds_vpc.id
|
| 49 |
+
|
| 50 |
+
tags = {
|
| 51 |
+
Name = "rds-public-igw"
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
resource "aws_subnet" "rds_subnet_1" {
|
| 56 |
+
vpc_id = aws_vpc.rds_vpc.id
|
| 57 |
+
cidr_block = "10.0.1.0/24"
|
| 58 |
+
availability_zone = data.aws_availability_zones.available.names[0]
|
| 59 |
+
map_public_ip_on_launch = true
|
| 60 |
+
|
| 61 |
+
tags = {
|
| 62 |
+
Name = "rds-public-subnet-1"
|
| 63 |
+
}
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
resource "aws_subnet" "rds_subnet_2" {
|
| 67 |
+
vpc_id = aws_vpc.rds_vpc.id
|
| 68 |
+
cidr_block = "10.0.2.0/24"
|
| 69 |
+
availability_zone = data.aws_availability_zones.available.names[1]
|
| 70 |
+
map_public_ip_on_launch = true
|
| 71 |
+
|
| 72 |
+
tags = {
|
| 73 |
+
Name = "rds-public-subnet-2"
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
resource "aws_route_table" "public_rt" {
|
| 78 |
+
vpc_id = aws_vpc.rds_vpc.id
|
| 79 |
+
|
| 80 |
+
route {
|
| 81 |
+
cidr_block = "0.0.0.0/0"
|
| 82 |
+
gateway_id = aws_internet_gateway.igw.id
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
tags = {
|
| 86 |
+
Name = "rds-public-rt"
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
resource "aws_route_table_association" "rta_1" {
|
| 91 |
+
subnet_id = aws_subnet.rds_subnet_1.id
|
| 92 |
+
route_table_id = aws_route_table.public_rt.id
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
resource "aws_route_table_association" "rta_2" {
|
| 96 |
+
subnet_id = aws_subnet.rds_subnet_2.id
|
| 97 |
+
route_table_id = aws_route_table.public_rt.id
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
resource "aws_security_group" "rds_sg" {
|
| 101 |
+
name = "rds-public-sg"
|
| 102 |
+
description = "Allow public access to PostgreSQL"
|
| 103 |
+
vpc_id = aws_vpc.rds_vpc.id
|
| 104 |
+
|
| 105 |
+
ingress {
|
| 106 |
+
description = "PostgreSQL from anywhere"
|
| 107 |
+
from_port = 5432
|
| 108 |
+
to_port = 5432
|
| 109 |
+
protocol = "tcp"
|
| 110 |
+
cidr_blocks = ["0.0.0.0/0"]
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
egress {
|
| 114 |
+
description = "Allow all outbound traffic"
|
| 115 |
+
from_port = 0
|
| 116 |
+
to_port = 0
|
| 117 |
+
protocol = "-1"
|
| 118 |
+
cidr_blocks = ["0.0.0.0/0"]
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
tags = {
|
| 122 |
+
Name = "rds-public-sg"
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
resource "aws_db_subnet_group" "rds_subnet_group" {
|
| 127 |
+
name = "rds-public-subnet-group"
|
| 128 |
+
subnet_ids = [aws_subnet.rds_subnet_1.id, aws_subnet.rds_subnet_2.id]
|
| 129 |
+
|
| 130 |
+
tags = {
|
| 131 |
+
Name = "rds-public-subnet-group"
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
resource "aws_db_instance" "postgres" {
|
| 136 |
+
identifier = "public-postgres-db"
|
| 137 |
+
engine = "postgres"
|
| 138 |
+
engine_version = "15.4"
|
| 139 |
+
instance_class = "db.t3.micro"
|
| 140 |
+
allocated_storage = 20
|
| 141 |
+
max_allocated_storage = 100
|
| 142 |
+
storage_type = "gp3"
|
| 143 |
+
db_name = "appdb"
|
| 144 |
+
username = var.db_username
|
| 145 |
+
password = var.db_password
|
| 146 |
+
publicly_accessible = true
|
| 147 |
+
vpc_security_group_ids = [aws_security_group.rds_sg.id]
|
| 148 |
+
db_subnet_group_name = aws_db_subnet_group.rds_subnet_group.name
|
| 149 |
+
skip_final_snapshot = true
|
| 150 |
+
multi_az = false
|
| 151 |
+
|
| 152 |
+
tags = {
|
| 153 |
+
Name = "public-postgres-db"
|
| 154 |
+
Environment = "production"
|
| 155 |
+
}
|
| 156 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-006/main.tf
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
aws = {
|
| 4 |
+
source = "hashicorp/aws"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "aws" {
|
| 11 |
+
region = "us-east-1"
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
data "aws_availability_zones" "available" {
|
| 15 |
+
state = "available"
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "aws_vpc" "main" {
|
| 19 |
+
cidr_block = "10.0.0.0/16"
|
| 20 |
+
enable_dns_support = true
|
| 21 |
+
enable_dns_hostnames = true
|
| 22 |
+
|
| 23 |
+
tags = {
|
| 24 |
+
Name = "main-vpc"
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
resource "aws_internet_gateway" "main" {
|
| 29 |
+
vpc_id = aws_vpc.main.id
|
| 30 |
+
|
| 31 |
+
tags = {
|
| 32 |
+
Name = "main-igw"
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
resource "aws_subnet" "public" {
|
| 37 |
+
vpc_id = aws_vpc.main.id
|
| 38 |
+
cidr_block = "10.0.1.0/24"
|
| 39 |
+
availability_zone = data.aws_availability_zones.available.names[0]
|
| 40 |
+
map_public_ip_on_launch = true
|
| 41 |
+
|
| 42 |
+
tags = {
|
| 43 |
+
Name = "public-subnet"
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
resource "aws_subnet" "private" {
|
| 48 |
+
vpc_id = aws_vpc.main.id
|
| 49 |
+
cidr_block = "10.0.2.0/24"
|
| 50 |
+
availability_zone = data.aws_availability_zones.available.names[0]
|
| 51 |
+
|
| 52 |
+
tags = {
|
| 53 |
+
Name = "private-subnet"
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
resource "aws_route_table" "public" {
|
| 58 |
+
vpc_id = aws_vpc.main.id
|
| 59 |
+
|
| 60 |
+
route {
|
| 61 |
+
cidr_block = "0.0.0.0/0"
|
| 62 |
+
gateway_id = aws_internet_gateway.main.id
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
tags = {
|
| 66 |
+
Name = "public-route-table"
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
resource "aws_route_table_association" "public" {
|
| 71 |
+
subnet_id = aws_subnet.public.id
|
| 72 |
+
route_table_id = aws_route_table.public.id
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
resource "aws_eip" "nat" {
|
| 76 |
+
domain = "vpc"
|
| 77 |
+
|
| 78 |
+
tags = {
|
| 79 |
+
Name = "nat-eip"
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
resource "aws_nat_gateway" "main" {
|
| 84 |
+
allocation_id = aws_eip.nat.id
|
| 85 |
+
subnet_id = aws_subnet.public.id
|
| 86 |
+
|
| 87 |
+
tags = {
|
| 88 |
+
Name = "main-nat-gateway"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
depends_on = [aws_internet_gateway.main]
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
resource "aws_route_table" "private" {
|
| 95 |
+
vpc_id = aws_vpc.main.id
|
| 96 |
+
|
| 97 |
+
route {
|
| 98 |
+
cidr_block = "0.0.0.0/0"
|
| 99 |
+
nat_gateway_id = aws_nat_gateway.main.id
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
tags = {
|
| 103 |
+
Name = "private-route-table"
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
resource "aws_route_table_association" "private" {
|
| 108 |
+
subnet_id = aws_subnet.private.id
|
| 109 |
+
route_table_id = aws_route_table.private.id
|
| 110 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-007/main.tf
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
data "aws_iam_policy_document" "assume_role" {
|
| 2 |
+
statement {
|
| 3 |
+
effect = "Allow"
|
| 4 |
+
actions = ["sts:AssumeRole"]
|
| 5 |
+
|
| 6 |
+
principals {
|
| 7 |
+
type = "Service"
|
| 8 |
+
identifiers = ["ec2.amazonaws.com"]
|
| 9 |
+
}
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
resource "aws_iam_role" "admin_role" {
|
| 14 |
+
name = "administrator-role"
|
| 15 |
+
description = "IAM Role with AdministratorAccess"
|
| 16 |
+
assume_role_policy = data.aws_iam_policy_document.assume_role.json
|
| 17 |
+
|
| 18 |
+
tags = {
|
| 19 |
+
Environment = "Production"
|
| 20 |
+
ManagedBy = "Terraform"
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
resource "aws_iam_role_policy_attachment" "admin_access" {
|
| 25 |
+
role = aws_iam_role.admin_role.name
|
| 26 |
+
policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess"
|
| 27 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-008/main.tf
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
aws = {
|
| 4 |
+
source = "hashicorp/aws"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
archive = {
|
| 8 |
+
source = "hashicorp/archive"
|
| 9 |
+
version = "~> 2.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
provider "aws" {
|
| 15 |
+
region = "us-east-1"
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
data "archive_file" "lambda_zip" {
|
| 19 |
+
type = "zip"
|
| 20 |
+
output_path = "${path.module}/lambda_function.zip"
|
| 21 |
+
|
| 22 |
+
source {
|
| 23 |
+
content = <<EOF
|
| 24 |
+
exports.handler = async (event) => {
|
| 25 |
+
return {
|
| 26 |
+
statusCode: 200,
|
| 27 |
+
headers: {
|
| 28 |
+
"Content-Type": "application/json"
|
| 29 |
+
},
|
| 30 |
+
body: JSON.stringify({ message: "Hello from Lambda!" })
|
| 31 |
+
};
|
| 32 |
+
};
|
| 33 |
+
EOF
|
| 34 |
+
filename = "index.js"
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
resource "aws_iam_role" "lambda_exec_role" {
|
| 39 |
+
name = "lambda_api_gateway_exec_role"
|
| 40 |
+
|
| 41 |
+
assume_role_policy = jsonencode({
|
| 42 |
+
Version = "2012-10-17"
|
| 43 |
+
Statement = [
|
| 44 |
+
{
|
| 45 |
+
Action = "sts:AssumeRole"
|
| 46 |
+
Effect = "Allow"
|
| 47 |
+
Principal = {
|
| 48 |
+
Service = "lambda.amazonaws.com"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
]
|
| 52 |
+
})
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
resource "aws_iam_role_policy_attachment" "lambda_basic_execution" {
|
| 56 |
+
role = aws_iam_role.lambda_exec_role.name
|
| 57 |
+
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
resource "aws_lambda_function" "api_lambda" {
|
| 61 |
+
function_name = "open_api_lambda"
|
| 62 |
+
role = aws_iam_role.lambda_exec_role.arn
|
| 63 |
+
handler = "index.handler"
|
| 64 |
+
runtime = "nodejs18.x"
|
| 65 |
+
filename = data.archive_file.lambda_zip.output_path
|
| 66 |
+
source_code_hash = data.archive_file.lambda_zip.output_base64sha256
|
| 67 |
+
timeout = 10
|
| 68 |
+
memory_size = 128
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
resource "aws_apigatewayv2_api" "http_api" {
|
| 72 |
+
name = "lambda-http-api"
|
| 73 |
+
protocol_type = "HTTP"
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
resource "aws_apigatewayv2_stage" "default" {
|
| 77 |
+
api_id = aws_apigatewayv2_api.http_api.id
|
| 78 |
+
name = "$default"
|
| 79 |
+
auto_deploy = true
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
resource "aws_apigatewayv2_integration" "lambda_integration" {
|
| 83 |
+
api_id = aws_apigatewayv2_api.http_api.id
|
| 84 |
+
integration_type = "AWS_PROXY"
|
| 85 |
+
integration_uri = aws_lambda_function.api_lambda.invoke_arn
|
| 86 |
+
integration_method = "POST"
|
| 87 |
+
payload_format_version = "2.0"
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
resource "aws_apigatewayv2_route" "default_route" {
|
| 91 |
+
api_id = aws_apigatewayv2_api.http_api.id
|
| 92 |
+
route_key = "ANY /{proxy+}"
|
| 93 |
+
target = "integrations/${aws_apigatewayv2_integration.lambda_integration.id}"
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
resource "aws_lambda_permission" "api_gw_invoke" {
|
| 97 |
+
statement_id = "AllowExecutionFromAPIGateway"
|
| 98 |
+
action = "lambda:InvokeFunction"
|
| 99 |
+
function_name = aws_lambda_function.api_lambda.function_name
|
| 100 |
+
principal = "apigateway.amazonaws.com"
|
| 101 |
+
source_arn = "${aws_apigatewayv2_api.http_api.execution_arn}/*/*"
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
output "api_endpoint" {
|
| 105 |
+
description = "The URI of the API Gateway"
|
| 106 |
+
value = aws_apigatewayv2_api.http_api.api_endpoint
|
| 107 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-009/main.tf
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
data "aws_iam_policy_document" "this" {
|
| 2 |
+
statement {
|
| 3 |
+
sid = "AllowAccessToAllAccounts"
|
| 4 |
+
effect = "Allow"
|
| 5 |
+
actions = ["kms:*"]
|
| 6 |
+
resources = ["*"]
|
| 7 |
+
|
| 8 |
+
principals {
|
| 9 |
+
type = "AWS"
|
| 10 |
+
identifiers = ["*"]
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
resource "aws_kms_key" "this" {
|
| 16 |
+
description = "KMS key with access allowed to all AWS accounts"
|
| 17 |
+
deletion_window_in_days = 30
|
| 18 |
+
enable_key_rotation = true
|
| 19 |
+
policy = data.aws_iam_policy_document.this.json
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
resource "aws_kms_alias" "this" {
|
| 23 |
+
name = "alias/global-access-key"
|
| 24 |
+
target_key_id = aws_kms_key.this.key_id
|
| 25 |
+
}
|
generated/simple/gemini-3.1-pro/aws-tf-010/main.tf
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_version = ">= 1.3.0"
|
| 3 |
+
required_providers {
|
| 4 |
+
aws = {
|
| 5 |
+
source = "hashicorp/aws"
|
| 6 |
+
version = ">= 5.31.0"
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
provider "aws" {
|
| 12 |
+
region = var.region
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
variable "region" {
|
| 16 |
+
description = "AWS region"
|
| 17 |
+
type = string
|
| 18 |
+
default = "us-east-1"
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
variable "cluster_name" {
|
| 22 |
+
description = "Name of the EKS cluster"
|
| 23 |
+
type = string
|
| 24 |
+
default = "main-eks-cluster"
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
data "aws_availability_zones" "available" {
|
| 28 |
+
state = "available"
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
module "vpc" {
|
| 32 |
+
source = "terraform-aws-modules/vpc/aws"
|
| 33 |
+
version = "~> 5.0"
|
| 34 |
+
|
| 35 |
+
name = "${var.cluster_name}-vpc"
|
| 36 |
+
cidr = "10.0.0.0/16"
|
| 37 |
+
|
| 38 |
+
azs = slice(data.aws_availability_zones.available.names, 0, 3)
|
| 39 |
+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
| 40 |
+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
|
| 41 |
+
|
| 42 |
+
enable_nat_gateway = true
|
| 43 |
+
single_nat_gateway = true
|
| 44 |
+
enable_dns_hostnames = true
|
| 45 |
+
enable_dns_support = true
|
| 46 |
+
|
| 47 |
+
public_subnet_tags = {
|
| 48 |
+
"kubernetes.io/role/elb" = 1
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
private_subnet_tags = {
|
| 52 |
+
"kubernetes.io/role/internal-elb" = 1
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
module "eks" {
|
| 57 |
+
source = "terraform-aws-modules/eks/aws"
|
| 58 |
+
version = "~> 20.0"
|
| 59 |
+
|
| 60 |
+
cluster_name = var.cluster_name
|
| 61 |
+
cluster_version = "1.30"
|
| 62 |
+
|
| 63 |
+
cluster_endpoint_public_access = true
|
| 64 |
+
|
| 65 |
+
vpc_id = module.vpc.vpc_id
|
| 66 |
+
subnet_ids = module.vpc.private_subnets
|
| 67 |
+
|
| 68 |
+
eks_managed_node_groups = {
|
| 69 |
+
default = {
|
| 70 |
+
min_size = 2
|
| 71 |
+
max_size = 5
|
| 72 |
+
desired_size = 2
|
| 73 |
+
|
| 74 |
+
instance_types = ["t3.medium"]
|
| 75 |
+
capacity_type = "ON_DEMAND"
|
| 76 |
+
}
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
enable_cluster_creator_admin_permissions = true
|
| 80 |
+
|
| 81 |
+
tags = {
|
| 82 |
+
Environment = "production"
|
| 83 |
+
Terraform = "true"
|
| 84 |
+
}
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
output "cluster_endpoint" {
|
| 88 |
+
description = "Endpoint for EKS control plane"
|
| 89 |
+
value = module.eks.cluster_endpoint
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
output "cluster_security_group_id" {
|
| 93 |
+
description = "Security group ids attached to the cluster control plane"
|
| 94 |
+
value = module.eks.cluster_security_group_id
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
output "cluster_name" {
|
| 98 |
+
description = "Kubernetes Cluster Name"
|
| 99 |
+
value = module.eks.cluster_name
|
| 100 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-001/main.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
| 3 |
+
"contentVersion": "1.0.0.0",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"storageAccountName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "Name of the storage account (must be globally unique, 3-24 lowercase letters and numbers)."
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
"containerName": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"defaultValue": "public-container",
|
| 14 |
+
"metadata": {
|
| 15 |
+
"description": "Name of the blob container."
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"location": {
|
| 19 |
+
"type": "string",
|
| 20 |
+
"defaultValue": "[resourceGroup().location]",
|
| 21 |
+
"metadata": {
|
| 22 |
+
"description": "Location for all resources."
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
+
"resources": [
|
| 27 |
+
{
|
| 28 |
+
"type": "Microsoft.Storage/storageAccounts",
|
| 29 |
+
"apiVersion": "2022-09-01",
|
| 30 |
+
"name": "[parameters('storageAccountName')]",
|
| 31 |
+
"location": "[parameters('location')]",
|
| 32 |
+
"sku": {
|
| 33 |
+
"name": "Standard_LRS"
|
| 34 |
+
},
|
| 35 |
+
"kind": "StorageV2",
|
| 36 |
+
"properties": {
|
| 37 |
+
"allowBlobPublicAccess": true
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"type": "Microsoft.Storage/storageAccounts/blobServices/containers",
|
| 42 |
+
"apiVersion": "2022-09-01",
|
| 43 |
+
"name": "[format('{0}/default/{1}', parameters('storageAccountName'), parameters('containerName'))]",
|
| 44 |
+
"dependsOn": [
|
| 45 |
+
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
|
| 46 |
+
],
|
| 47 |
+
"properties": {
|
| 48 |
+
"publicAccess": "Container"
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
]
|
| 52 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-002/main.json
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
| 3 |
+
"contentVersion": "1.0.0.0",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"vmName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"defaultValue": "WinVM",
|
| 8 |
+
"metadata": {
|
| 9 |
+
"description": "Name of the virtual machine."
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"adminUsername": {
|
| 13 |
+
"type": "string",
|
| 14 |
+
"metadata": {
|
| 15 |
+
"description": "Username for the Virtual Machine."
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"adminPassword": {
|
| 19 |
+
"type": "securestring",
|
| 20 |
+
"metadata": {
|
| 21 |
+
"description": "Password for the Virtual Machine."
|
| 22 |
+
}
|
| 23 |
+
},
|
| 24 |
+
"windowsOSVersion": {
|
| 25 |
+
"type": "string",
|
| 26 |
+
"defaultValue": "2022-datacenter-g2",
|
| 27 |
+
"allowedValues": [
|
| 28 |
+
"2016-datacenter-gensecond",
|
| 29 |
+
"2019-datacenter-gensecond",
|
| 30 |
+
"2022-datacenter-g2"
|
| 31 |
+
],
|
| 32 |
+
"metadata": {
|
| 33 |
+
"description": "The Windows version for the VM."
|
| 34 |
+
}
|
| 35 |
+
},
|
| 36 |
+
"vmSize": {
|
| 37 |
+
"type": "string",
|
| 38 |
+
"defaultValue": "Standard_D2s_v3",
|
| 39 |
+
"metadata": {
|
| 40 |
+
"description": "Size of the virtual machine."
|
| 41 |
+
}
|
| 42 |
+
},
|
| 43 |
+
"location": {
|
| 44 |
+
"type": "string",
|
| 45 |
+
"defaultValue": "[resourceGroup().location]",
|
| 46 |
+
"metadata": {
|
| 47 |
+
"description": "Location for all resources."
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
"variables": {
|
| 52 |
+
"nicName": "[format('{0}-nic', parameters('vmName'))]",
|
| 53 |
+
"addressPrefix": "10.0.0.0/16",
|
| 54 |
+
"subnetName": "default",
|
| 55 |
+
"subnetPrefix": "10.0.0.0/24",
|
| 56 |
+
"publicIPAddressName": "[format('{0}-pip', parameters('vmName'))]",
|
| 57 |
+
"virtualNetworkName": "[format('{0}-vnet', parameters('vmName'))]",
|
| 58 |
+
"networkSecurityGroupName": "[format('{0}-nsg', parameters('vmName'))]"
|
| 59 |
+
},
|
| 60 |
+
"resources": [
|
| 61 |
+
{
|
| 62 |
+
"type": "Microsoft.Network/networkSecurityGroups",
|
| 63 |
+
"apiVersion": "2023-09-01",
|
| 64 |
+
"name": "[variables('networkSecurityGroupName')]",
|
| 65 |
+
"location": "[parameters('location')]",
|
| 66 |
+
"properties": {
|
| 67 |
+
"securityRules": [
|
| 68 |
+
{
|
| 69 |
+
"name": "RDP",
|
| 70 |
+
"properties": {
|
| 71 |
+
"priority": 1000,
|
| 72 |
+
"access": "Allow",
|
| 73 |
+
"direction": "Inbound",
|
| 74 |
+
"destinationPortRange": "3389",
|
| 75 |
+
"protocol": "Tcp",
|
| 76 |
+
"sourcePortRange": "*",
|
| 77 |
+
"sourceAddressPrefix": "*",
|
| 78 |
+
"destinationAddressPrefix": "*"
|
| 79 |
+
}
|
| 80 |
+
}
|
| 81 |
+
]
|
| 82 |
+
}
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"type": "Microsoft.Network/publicIPAddresses",
|
| 86 |
+
"apiVersion": "2023-09-01",
|
| 87 |
+
"name": "[variables('publicIPAddressName')]",
|
| 88 |
+
"location": "[parameters('location')]",
|
| 89 |
+
"sku": {
|
| 90 |
+
"name": "Standard"
|
| 91 |
+
},
|
| 92 |
+
"properties": {
|
| 93 |
+
"publicIPAllocationMethod": "Static"
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"type": "Microsoft.Network/virtualNetworks",
|
| 98 |
+
"apiVersion": "2023-09-01",
|
| 99 |
+
"name": "[variables('virtualNetworkName')]",
|
| 100 |
+
"location": "[parameters('location')]",
|
| 101 |
+
"properties": {
|
| 102 |
+
"addressSpace": {
|
| 103 |
+
"addressPrefixes": [
|
| 104 |
+
"[variables('addressPrefix')]"
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
"subnets": [
|
| 108 |
+
{
|
| 109 |
+
"name": "[variables('subnetName')]",
|
| 110 |
+
"properties": {
|
| 111 |
+
"addressPrefix": "[variables('subnetPrefix')]"
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
]
|
| 115 |
+
}
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"type": "Microsoft.Network/networkInterfaces",
|
| 119 |
+
"apiVersion": "2023-09-01",
|
| 120 |
+
"name": "[variables('nicName')]",
|
| 121 |
+
"location": "[parameters('location')]",
|
| 122 |
+
"dependsOn": [
|
| 123 |
+
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
|
| 124 |
+
"[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]",
|
| 125 |
+
"[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
|
| 126 |
+
],
|
| 127 |
+
"properties": {
|
| 128 |
+
"ipConfigurations": [
|
| 129 |
+
{
|
| 130 |
+
"name": "ipconfig1",
|
| 131 |
+
"properties": {
|
| 132 |
+
"privateIPAllocationMethod": "Dynamic",
|
| 133 |
+
"publicIPAddress": {
|
| 134 |
+
"id": "[resourceId('Microsoft.Network/publicIPAddresses', variables('publicIPAddressName'))]"
|
| 135 |
+
},
|
| 136 |
+
"subnet": {
|
| 137 |
+
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('subnetName'))]"
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
],
|
| 142 |
+
"networkSecurityGroup": {
|
| 143 |
+
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]"
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
"type": "Microsoft.Compute/virtualMachines",
|
| 149 |
+
"apiVersion": "2023-09-01",
|
| 150 |
+
"name": "[parameters('vmName')]",
|
| 151 |
+
"location": "[parameters('location')]",
|
| 152 |
+
"dependsOn": [
|
| 153 |
+
"[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
| 154 |
+
],
|
| 155 |
+
"properties": {
|
| 156 |
+
"hardwareProfile": {
|
| 157 |
+
"vmSize": "[parameters('vmSize')]"
|
| 158 |
+
},
|
| 159 |
+
"osProfile": {
|
| 160 |
+
"computerName": "[parameters('vmName')]",
|
| 161 |
+
"adminUsername": "[parameters('adminUsername')]",
|
| 162 |
+
"adminPassword": "[parameters('adminPassword')]"
|
| 163 |
+
},
|
| 164 |
+
"storageProfile": {
|
| 165 |
+
"imageReference": {
|
| 166 |
+
"publisher": "MicrosoftWindowsServer",
|
| 167 |
+
"offer": "WindowsServer",
|
| 168 |
+
"sku": "[parameters('windowsOSVersion')]",
|
| 169 |
+
"version": "latest"
|
| 170 |
+
},
|
| 171 |
+
"osDisk": {
|
| 172 |
+
"createOption": "FromImage",
|
| 173 |
+
"managedDisk": {
|
| 174 |
+
"storageAccountType": "StandardSSD_LRS"
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
},
|
| 178 |
+
"networkProfile": {
|
| 179 |
+
"networkInterfaces": [
|
| 180 |
+
{
|
| 181 |
+
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
|
| 182 |
+
}
|
| 183 |
+
]
|
| 184 |
+
}
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
]
|
| 188 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-003/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 |
+
"serverName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "The name of the Azure SQL Server."
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
"administratorLogin": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"metadata": {
|
| 14 |
+
"description": "The administrator username for the SQL Server."
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"administratorLoginPassword": {
|
| 18 |
+
"type": "securestring",
|
| 19 |
+
"metadata": {
|
| 20 |
+
"description": "The administrator password for the SQL Server."
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
"databaseName": {
|
| 24 |
+
"type": "string",
|
| 25 |
+
"defaultValue": "mySampleDatabase",
|
| 26 |
+
"metadata": {
|
| 27 |
+
"description": "The name of the SQL Database."
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"location": {
|
| 31 |
+
"type": "string",
|
| 32 |
+
"defaultValue": "[resourceGroup().location]",
|
| 33 |
+
"metadata": {
|
| 34 |
+
"description": "The location in which the resources should be deployed."
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
},
|
| 38 |
+
"resources": [
|
| 39 |
+
{
|
| 40 |
+
"type": "Microsoft.Sql/servers",
|
| 41 |
+
"apiVersion": "2021-11-01",
|
| 42 |
+
"name": "[parameters('serverName')]",
|
| 43 |
+
"location": "[parameters('location')]",
|
| 44 |
+
"properties": {
|
| 45 |
+
"administratorLogin": "[parameters('administratorLogin')]",
|
| 46 |
+
"administratorLoginPassword": "[parameters('administratorLoginPassword')]",
|
| 47 |
+
"version": "12.0"
|
| 48 |
+
}
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"type": "Microsoft.Sql/servers/databases",
|
| 52 |
+
"apiVersion": "2021-11-01",
|
| 53 |
+
"name": "[format('{0}/{1}', parameters('serverName'), parameters('databaseName'))]",
|
| 54 |
+
"location": "[parameters('location')]",
|
| 55 |
+
"dependsOn": [
|
| 56 |
+
"[resourceId('Microsoft.Sql/servers', parameters('serverName'))]"
|
| 57 |
+
],
|
| 58 |
+
"sku": {
|
| 59 |
+
"name": "Standard",
|
| 60 |
+
"tier": "Standard"
|
| 61 |
+
},
|
| 62 |
+
"properties": {
|
| 63 |
+
"collation": "SQL_Latin1_General_CP1_CI_AS"
|
| 64 |
+
}
|
| 65 |
+
},
|
| 66 |
+
{
|
| 67 |
+
"type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
|
| 68 |
+
"apiVersion": "2021-11-01",
|
| 69 |
+
"name": "[format('{0}/{1}/current', parameters('serverName'), parameters('databaseName'))]",
|
| 70 |
+
"dependsOn": [
|
| 71 |
+
"[resourceId('Microsoft.Sql/servers/databases', parameters('serverName'), parameters('databaseName'))]"
|
| 72 |
+
],
|
| 73 |
+
"properties": {
|
| 74 |
+
"state": "Disabled"
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
]
|
| 78 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-004/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 |
+
"parameters": {
|
| 5 |
+
"vnetName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"defaultValue": "vnet-main",
|
| 8 |
+
"metadata": {
|
| 9 |
+
"description": "Name of the Virtual Network"
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"location": {
|
| 13 |
+
"type": "string",
|
| 14 |
+
"defaultValue": "[resourceGroup().location]",
|
| 15 |
+
"metadata": {
|
| 16 |
+
"description": "Location for the Virtual Network"
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"vnetAddressPrefix": {
|
| 20 |
+
"type": "string",
|
| 21 |
+
"defaultValue": "10.0.0.0/16",
|
| 22 |
+
"metadata": {
|
| 23 |
+
"description": "Address space for the Virtual Network"
|
| 24 |
+
}
|
| 25 |
+
},
|
| 26 |
+
"subnetName": {
|
| 27 |
+
"type": "string",
|
| 28 |
+
"defaultValue": "snet-public",
|
| 29 |
+
"metadata": {
|
| 30 |
+
"description": "Name of the public subnet"
|
| 31 |
+
}
|
| 32 |
+
},
|
| 33 |
+
"subnetAddressPrefix": {
|
| 34 |
+
"type": "string",
|
| 35 |
+
"defaultValue": "10.0.0.0/24",
|
| 36 |
+
"metadata": {
|
| 37 |
+
"description": "Address prefix for the public subnet"
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"resources": [
|
| 42 |
+
{
|
| 43 |
+
"type": "Microsoft.Network/virtualNetworks",
|
| 44 |
+
"apiVersion": "2023-04-01",
|
| 45 |
+
"name": "[parameters('vnetName')]",
|
| 46 |
+
"location": "[parameters('location')]",
|
| 47 |
+
"properties": {
|
| 48 |
+
"addressSpace": {
|
| 49 |
+
"addressPrefixes": [
|
| 50 |
+
"[parameters('vnetAddressPrefix')]"
|
| 51 |
+
]
|
| 52 |
+
},
|
| 53 |
+
"subnets": [
|
| 54 |
+
{
|
| 55 |
+
"name": "[parameters('subnetName')]",
|
| 56 |
+
"properties": {
|
| 57 |
+
"addressPrefix": "[parameters('subnetAddressPrefix')]"
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
]
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
],
|
| 64 |
+
"outputs": {
|
| 65 |
+
"vnetId": {
|
| 66 |
+
"type": "string",
|
| 67 |
+
"value": "[resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName'))]"
|
| 68 |
+
},
|
| 69 |
+
"subnetId": {
|
| 70 |
+
"type": "string",
|
| 71 |
+
"value": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-005/main.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
| 3 |
+
"contentVersion": "1.0.0.0",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"webAppName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "The name of the web app."
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
"location": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"defaultValue": "[resourceGroup().location]",
|
| 14 |
+
"metadata": {
|
| 15 |
+
"description": "Location for all resources."
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"skuName": {
|
| 19 |
+
"type": "string",
|
| 20 |
+
"defaultValue": "S1",
|
| 21 |
+
"metadata": {
|
| 22 |
+
"description": "The SKU of App Service Plan."
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"skuCapacity": {
|
| 26 |
+
"type": "int",
|
| 27 |
+
"defaultValue": 1,
|
| 28 |
+
"metadata": {
|
| 29 |
+
"description": "The number of instances for the App Service Plan."
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
},
|
| 33 |
+
"variables": {
|
| 34 |
+
"appServicePlanName": "[format('asp-{0}', parameters('webAppName'))]"
|
| 35 |
+
},
|
| 36 |
+
"resources": [
|
| 37 |
+
{
|
| 38 |
+
"type": "Microsoft.Web/serverfarms",
|
| 39 |
+
"apiVersion": "2022-09-01",
|
| 40 |
+
"name": "[variables('appServicePlanName')]",
|
| 41 |
+
"location": "[parameters('location')]",
|
| 42 |
+
"sku": {
|
| 43 |
+
"name": "[parameters('skuName')]",
|
| 44 |
+
"capacity": "[parameters('skuCapacity')]"
|
| 45 |
+
},
|
| 46 |
+
"properties": {}
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "Microsoft.Web/sites",
|
| 50 |
+
"apiVersion": "2022-09-01",
|
| 51 |
+
"name": "[parameters('webAppName')]",
|
| 52 |
+
"location": "[parameters('location')]",
|
| 53 |
+
"dependsOn": [
|
| 54 |
+
"[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]"
|
| 55 |
+
],
|
| 56 |
+
"properties": {
|
| 57 |
+
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appServicePlanName'))]",
|
| 58 |
+
"httpsOnly": false
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
]
|
| 62 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-006/main.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
| 3 |
+
"contentVersion": "1.0.0.0",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"keyVaultName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "The name of the Key Vault. Must be globally unique, between 3-24 alphanumeric characters."
|
| 9 |
+
},
|
| 10 |
+
"minLength": 3,
|
| 11 |
+
"maxLength": 24
|
| 12 |
+
},
|
| 13 |
+
"location": {
|
| 14 |
+
"type": "string",
|
| 15 |
+
"defaultValue": "[resourceGroup().location]",
|
| 16 |
+
"metadata": {
|
| 17 |
+
"description": "The location in which the Key Vault should be deployed."
|
| 18 |
+
}
|
| 19 |
+
},
|
| 20 |
+
"tenantId": {
|
| 21 |
+
"type": "string",
|
| 22 |
+
"defaultValue": "[subscription().tenantId]",
|
| 23 |
+
"metadata": {
|
| 24 |
+
"description": "The Azure Active Directory tenant ID that should be used for authenticating requests to the key vault."
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
},
|
| 28 |
+
"resources": [
|
| 29 |
+
{
|
| 30 |
+
"type": "Microsoft.KeyVault/vaults",
|
| 31 |
+
"apiVersion": "2023-02-01",
|
| 32 |
+
"name": "[parameters('keyVaultName')]",
|
| 33 |
+
"location": "[parameters('location')]",
|
| 34 |
+
"properties": {
|
| 35 |
+
"tenantId": "[parameters('tenantId')]",
|
| 36 |
+
"sku": {
|
| 37 |
+
"family": "A",
|
| 38 |
+
"name": "standard"
|
| 39 |
+
},
|
| 40 |
+
"accessPolicies": [],
|
| 41 |
+
"enabledForDeployment": false,
|
| 42 |
+
"enabledForDiskEncryption": false,
|
| 43 |
+
"enabledForTemplateDeployment": false,
|
| 44 |
+
"enableSoftDelete": true,
|
| 45 |
+
"softDeleteRetentionInDays": 90,
|
| 46 |
+
"enableRbacAuthorization": false,
|
| 47 |
+
"publicNetworkAccess": "Enabled",
|
| 48 |
+
"networkAcls": {
|
| 49 |
+
"defaultAction": "Allow",
|
| 50 |
+
"bypass": "AzureServices",
|
| 51 |
+
"ipRules": [],
|
| 52 |
+
"virtualNetworkRules": []
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
]
|
| 57 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-007/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 |
+
"parameters": {
|
| 5 |
+
"redisCacheName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "The name of the Azure Redis Cache."
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
"location": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"defaultValue": "[resourceGroup().location]",
|
| 14 |
+
"metadata": {
|
| 15 |
+
"description": "The location of the Redis Cache."
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"redisCacheSKU": {
|
| 19 |
+
"type": "string",
|
| 20 |
+
"defaultValue": "Basic",
|
| 21 |
+
"allowedValues": [
|
| 22 |
+
"Basic",
|
| 23 |
+
"Standard",
|
| 24 |
+
"Premium"
|
| 25 |
+
],
|
| 26 |
+
"metadata": {
|
| 27 |
+
"description": "The pricing tier of the new Redis Cache."
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"redisCacheFamily": {
|
| 31 |
+
"type": "string",
|
| 32 |
+
"defaultValue": "C",
|
| 33 |
+
"allowedValues": [
|
| 34 |
+
"C",
|
| 35 |
+
"P"
|
| 36 |
+
],
|
| 37 |
+
"metadata": {
|
| 38 |
+
"description": "The family for the sku."
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"redisCacheCapacity": {
|
| 42 |
+
"type": "int",
|
| 43 |
+
"defaultValue": 0,
|
| 44 |
+
"allowedValues": [
|
| 45 |
+
0,
|
| 46 |
+
1,
|
| 47 |
+
2,
|
| 48 |
+
3,
|
| 49 |
+
4,
|
| 50 |
+
5,
|
| 51 |
+
6
|
| 52 |
+
],
|
| 53 |
+
"metadata": {
|
| 54 |
+
"description": "The size of the new Redis Cache instance."
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
},
|
| 58 |
+
"resources": [
|
| 59 |
+
{
|
| 60 |
+
"type": "Microsoft.Cache/redis",
|
| 61 |
+
"apiVersion": "2023-08-01",
|
| 62 |
+
"name": "[parameters('redisCacheName')]",
|
| 63 |
+
"location": "[parameters('location')]",
|
| 64 |
+
"properties": {
|
| 65 |
+
"enableNonSslPort": true,
|
| 66 |
+
"sku": {
|
| 67 |
+
"name": "[parameters('redisCacheSKU')]",
|
| 68 |
+
"family": "[parameters('redisCacheFamily')]",
|
| 69 |
+
"capacity": "[parameters('redisCacheCapacity')]"
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
]
|
| 74 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-008/main.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
| 3 |
+
"contentVersion": "1.0.0.0",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"eventHubNamespaceName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "Name of the Event Hub namespace"
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
"location": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"defaultValue": "[resourceGroup().location]",
|
| 14 |
+
"metadata": {
|
| 15 |
+
"description": "Location for the Event Hub namespace."
|
| 16 |
+
}
|
| 17 |
+
},
|
| 18 |
+
"sku": {
|
| 19 |
+
"type": "string",
|
| 20 |
+
"defaultValue": "Standard",
|
| 21 |
+
"allowedValues": [
|
| 22 |
+
"Basic",
|
| 23 |
+
"Standard",
|
| 24 |
+
"Premium"
|
| 25 |
+
],
|
| 26 |
+
"metadata": {
|
| 27 |
+
"description": "The messaging tier for the Event Hub namespace."
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"capacity": {
|
| 31 |
+
"type": "int",
|
| 32 |
+
"defaultValue": 1,
|
| 33 |
+
"metadata": {
|
| 34 |
+
"description": "The Event Hub throughput units."
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
},
|
| 38 |
+
"resources": [
|
| 39 |
+
{
|
| 40 |
+
"type": "Microsoft.EventHub/namespaces",
|
| 41 |
+
"apiVersion": "2021-11-01",
|
| 42 |
+
"name": "[parameters('eventHubNamespaceName')]",
|
| 43 |
+
"location": "[parameters('location')]",
|
| 44 |
+
"sku": {
|
| 45 |
+
"name": "[parameters('sku')]",
|
| 46 |
+
"tier": "[parameters('sku')]",
|
| 47 |
+
"capacity": "[parameters('capacity')]"
|
| 48 |
+
},
|
| 49 |
+
"properties": {
|
| 50 |
+
"publicNetworkAccess": "Enabled"
|
| 51 |
+
}
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"type": "Microsoft.EventHub/namespaces/networkRuleSets",
|
| 55 |
+
"apiVersion": "2021-11-01",
|
| 56 |
+
"name": "[format('{0}/default', parameters('eventHubNamespaceName'))]",
|
| 57 |
+
"dependsOn": [
|
| 58 |
+
"[resourceId('Microsoft.EventHub/namespaces', parameters('eventHubNamespaceName'))]"
|
| 59 |
+
],
|
| 60 |
+
"properties": {
|
| 61 |
+
"publicNetworkAccess": "Enabled",
|
| 62 |
+
"defaultAction": "Allow",
|
| 63 |
+
"virtualNetworkRules": [],
|
| 64 |
+
"ipRules": []
|
| 65 |
+
}
|
| 66 |
+
}
|
| 67 |
+
]
|
| 68 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-009/main.json
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
|
| 3 |
+
"contentVersion": "1.0.0.0",
|
| 4 |
+
"parameters": {
|
| 5 |
+
"workspaceName": {
|
| 6 |
+
"type": "string",
|
| 7 |
+
"metadata": {
|
| 8 |
+
"description": "Specifies the name of the Azure Machine Learning workspace."
|
| 9 |
+
}
|
| 10 |
+
},
|
| 11 |
+
"location": {
|
| 12 |
+
"type": "string",
|
| 13 |
+
"defaultValue": "[resourceGroup().location]",
|
| 14 |
+
"metadata": {
|
| 15 |
+
"description": "Specifies the location for all resources."
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"variables": {
|
| 20 |
+
"storageAccountName": "[format('st{0}', uniqueString(resourceGroup().id, parameters('workspaceName')))]",
|
| 21 |
+
"keyVaultName": "[format('kv-{0}', uniqueString(resourceGroup().id, parameters('workspaceName')))]",
|
| 22 |
+
"applicationInsightsName": "[format('appi-{0}', uniqueString(resourceGroup().id, parameters('workspaceName')))]",
|
| 23 |
+
"containerRegistryName": "[format('cr{0}', uniqueString(resourceGroup().id, parameters('workspaceName')))]",
|
| 24 |
+
"tenantId": "[subscription().tenantId]"
|
| 25 |
+
},
|
| 26 |
+
"resources": [
|
| 27 |
+
{
|
| 28 |
+
"type": "Microsoft.Storage/storageAccounts",
|
| 29 |
+
"apiVersion": "2022-09-01",
|
| 30 |
+
"name": "[variables('storageAccountName')]",
|
| 31 |
+
"location": "[parameters('location')]",
|
| 32 |
+
"sku": {
|
| 33 |
+
"name": "Standard_LRS"
|
| 34 |
+
},
|
| 35 |
+
"kind": "StorageV2",
|
| 36 |
+
"properties": {
|
| 37 |
+
"encryption": {
|
| 38 |
+
"services": {
|
| 39 |
+
"blob": {
|
| 40 |
+
"enabled": true
|
| 41 |
+
},
|
| 42 |
+
"file": {
|
| 43 |
+
"enabled": true
|
| 44 |
+
}
|
| 45 |
+
},
|
| 46 |
+
"keySource": "Microsoft.Storage"
|
| 47 |
+
},
|
| 48 |
+
"supportsHttpsTrafficOnly": true,
|
| 49 |
+
"minimumTlsVersion": "TLS1_2"
|
| 50 |
+
}
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"type": "Microsoft.KeyVault/vaults",
|
| 54 |
+
"apiVersion": "2022-07-01",
|
| 55 |
+
"name": "[variables('keyVaultName')]",
|
| 56 |
+
"location": "[parameters('location')]",
|
| 57 |
+
"properties": {
|
| 58 |
+
"tenantId": "[variables('tenantId')]",
|
| 59 |
+
"sku": {
|
| 60 |
+
"name": "standard",
|
| 61 |
+
"family": "A"
|
| 62 |
+
},
|
| 63 |
+
"accessPolicies": [],
|
| 64 |
+
"enableSoftDelete": true,
|
| 65 |
+
"softDeleteRetentionInDays": 7,
|
| 66 |
+
"enablePurgeProtection": true
|
| 67 |
+
}
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"type": "Microsoft.Insights/components",
|
| 71 |
+
"apiVersion": "2020-02-02",
|
| 72 |
+
"name": "[variables('applicationInsightsName')]",
|
| 73 |
+
"location": "[parameters('location')]",
|
| 74 |
+
"kind": "web",
|
| 75 |
+
"properties": {
|
| 76 |
+
"Application_Type": "web"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"type": "Microsoft.ContainerRegistry/registries",
|
| 81 |
+
"apiVersion": "2022-12-01",
|
| 82 |
+
"name": "[variables('containerRegistryName')]",
|
| 83 |
+
"location": "[parameters('location')]",
|
| 84 |
+
"sku": {
|
| 85 |
+
"name": "Standard"
|
| 86 |
+
},
|
| 87 |
+
"properties": {
|
| 88 |
+
"adminUserEnabled": true
|
| 89 |
+
}
|
| 90 |
+
},
|
| 91 |
+
{
|
| 92 |
+
"type": "Microsoft.MachineLearningServices/workspaces",
|
| 93 |
+
"apiVersion": "2023-04-01",
|
| 94 |
+
"name": "[parameters('workspaceName')]",
|
| 95 |
+
"location": "[parameters('location')]",
|
| 96 |
+
"identity": {
|
| 97 |
+
"type": "SystemAssigned"
|
| 98 |
+
},
|
| 99 |
+
"dependsOn": [
|
| 100 |
+
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
|
| 101 |
+
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]",
|
| 102 |
+
"[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]",
|
| 103 |
+
"[resourceId('Microsoft.ContainerRegistry/registries', variables('containerRegistryName'))]"
|
| 104 |
+
],
|
| 105 |
+
"properties": {
|
| 106 |
+
"friendlyName": "[parameters('workspaceName')]",
|
| 107 |
+
"storageAccount": "[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
|
| 108 |
+
"keyVault": "[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]",
|
| 109 |
+
"applicationInsights": "[resourceId('Microsoft.Insights/components', variables('applicationInsightsName'))]",
|
| 110 |
+
"containerRegistry": "[resourceId('Microsoft.ContainerRegistry/registries', variables('containerRegistryName'))]",
|
| 111 |
+
"publicNetworkAccess": "Enabled"
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
],
|
| 115 |
+
"outputs": {
|
| 116 |
+
"workspaceId": {
|
| 117 |
+
"type": "string",
|
| 118 |
+
"value": "[resourceId('Microsoft.MachineLearningServices/workspaces', parameters('workspaceName'))]"
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
}
|
generated/simple/gemini-3.1-pro/az-arm-010/main.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
"publicIpName": {
|
| 13 |
+
"type": "string",
|
| 14 |
+
"defaultValue": "myPublicIP",
|
| 15 |
+
"metadata": {
|
| 16 |
+
"description": "Name of the public IP address"
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"location": {
|
| 20 |
+
"type": "string",
|
| 21 |
+
"defaultValue": "[resourceGroup().location]",
|
| 22 |
+
"metadata": {
|
| 23 |
+
"description": "Location for all resources"
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"resources": [
|
| 28 |
+
{
|
| 29 |
+
"type": "Microsoft.Network/publicIPAddresses",
|
| 30 |
+
"apiVersion": "2023-04-01",
|
| 31 |
+
"name": "[parameters('publicIpName')]",
|
| 32 |
+
"location": "[parameters('location')]",
|
| 33 |
+
"sku": {
|
| 34 |
+
"name": "Standard"
|
| 35 |
+
},
|
| 36 |
+
"properties": {
|
| 37 |
+
"publicIPAllocationMethod": "Static"
|
| 38 |
+
}
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"type": "Microsoft.Network/loadBalancers",
|
| 42 |
+
"apiVersion": "2023-04-01",
|
| 43 |
+
"name": "[parameters('loadBalancerName')]",
|
| 44 |
+
"location": "[parameters('location')]",
|
| 45 |
+
"sku": {
|
| 46 |
+
"name": "Standard"
|
| 47 |
+
},
|
| 48 |
+
"dependsOn": [
|
| 49 |
+
"[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIpName'))]"
|
| 50 |
+
],
|
| 51 |
+
"properties": {
|
| 52 |
+
"frontendIPConfigurations": [
|
| 53 |
+
{
|
| 54 |
+
"name": "PublicFrontendIP",
|
| 55 |
+
"properties": {
|
| 56 |
+
"publicIPAddress": {
|
| 57 |
+
"id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIpName'))]"
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
],
|
| 62 |
+
"backendAddressPools": [
|
| 63 |
+
{
|
| 64 |
+
"name": "BackendPool"
|
| 65 |
+
}
|
| 66 |
+
],
|
| 67 |
+
"probes": [
|
| 68 |
+
{
|
| 69 |
+
"name": "HealthProbe",
|
| 70 |
+
"properties": {
|
| 71 |
+
"protocol": "Tcp",
|
| 72 |
+
"port": 80,
|
| 73 |
+
"intervalInSeconds": 15,
|
| 74 |
+
"numberOfProbes": 2
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
],
|
| 78 |
+
"loadBalancingRules": [
|
| 79 |
+
{
|
| 80 |
+
"name": "HTTPRule",
|
| 81 |
+
"properties": {
|
| 82 |
+
"frontendIPConfiguration": {
|
| 83 |
+
"id": "[resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', parameters('loadBalancerName'), 'PublicFrontendIP')]"
|
| 84 |
+
},
|
| 85 |
+
"backendAddressPool": {
|
| 86 |
+
"id": "[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', parameters('loadBalancerName'), 'BackendPool')]"
|
| 87 |
+
},
|
| 88 |
+
"probe": {
|
| 89 |
+
"id": "[resourceId('Microsoft.Network/loadBalancers/probes', parameters('loadBalancerName'), 'HealthProbe')]"
|
| 90 |
+
},
|
| 91 |
+
"protocol": "Tcp",
|
| 92 |
+
"frontendPort": 80,
|
| 93 |
+
"backendPort": 80,
|
| 94 |
+
"idleTimeoutInMinutes": 4,
|
| 95 |
+
"enableFloatingIP": false,
|
| 96 |
+
"loadDistribution": "Default"
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
]
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
],
|
| 103 |
+
"outputs": {
|
| 104 |
+
"loadBalancerId": {
|
| 105 |
+
"type": "string",
|
| 106 |
+
"value": "[resourceId('Microsoft.Network/loadBalancers', parameters('loadBalancerName'))]"
|
| 107 |
+
},
|
| 108 |
+
"publicIpAddressId": {
|
| 109 |
+
"type": "string",
|
| 110 |
+
"value": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIpName'))]"
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-001/main.tf
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "azurerm" {
|
| 11 |
+
features {}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "azurerm_resource_group" "example" {
|
| 15 |
+
name = "rg-public-storage-example"
|
| 16 |
+
location = "East US"
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
resource "azurerm_storage_account" "example" {
|
| 20 |
+
name = "examplestorageacc12345"
|
| 21 |
+
resource_group_name = azurerm_resource_group.example.name
|
| 22 |
+
location = azurerm_resource_group.example.location
|
| 23 |
+
account_tier = "Standard"
|
| 24 |
+
account_replication_type = "LRS"
|
| 25 |
+
|
| 26 |
+
# Explicitly allow public access to blobs/containers
|
| 27 |
+
allow_nested_items_to_be_public = true
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
resource "azurerm_storage_container" "example" {
|
| 31 |
+
name = "public-blob-container"
|
| 32 |
+
storage_account_name = azurerm_storage_account.example.name
|
| 33 |
+
|
| 34 |
+
# Set access type to allow public read access for blobs
|
| 35 |
+
container_access_type = "blob"
|
| 36 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-002/main.tf
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
tls = {
|
| 8 |
+
source = "hashicorp/tls"
|
| 9 |
+
version = "~> 4.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
provider "azurerm" {
|
| 15 |
+
features {}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "azurerm_resource_group" "rg" {
|
| 19 |
+
name = "rg-linux-vm-prod"
|
| 20 |
+
location = "East US"
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
resource "azurerm_virtual_network" "vnet" {
|
| 24 |
+
name = "vnet-prod"
|
| 25 |
+
address_space = ["10.0.0.0/16"]
|
| 26 |
+
location = azurerm_resource_group.rg.location
|
| 27 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
resource "azurerm_subnet" "subnet" {
|
| 31 |
+
name = "snet-prod"
|
| 32 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 33 |
+
virtual_network_name = azurerm_virtual_network.vnet.name
|
| 34 |
+
address_prefixes = ["10.0.1.0/24"]
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
resource "azurerm_public_ip" "pip" {
|
| 38 |
+
name = "pip-linux-vm"
|
| 39 |
+
location = azurerm_resource_group.rg.location
|
| 40 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 41 |
+
allocation_method = "Static"
|
| 42 |
+
sku = "Standard"
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
resource "azurerm_network_security_group" "nsg" {
|
| 46 |
+
name = "nsg-linux-vm"
|
| 47 |
+
location = azurerm_resource_group.rg.location
|
| 48 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 49 |
+
|
| 50 |
+
security_rule {
|
| 51 |
+
name = "Allow-SSH"
|
| 52 |
+
priority = 1001
|
| 53 |
+
direction = "Inbound"
|
| 54 |
+
access = "Allow"
|
| 55 |
+
protocol = "Tcp"
|
| 56 |
+
source_port_range = "*"
|
| 57 |
+
destination_port_range = "22"
|
| 58 |
+
source_address_prefix = "*"
|
| 59 |
+
destination_address_prefix = "*"
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
resource "azurerm_network_interface" "nic" {
|
| 64 |
+
name = "nic-linux-vm"
|
| 65 |
+
location = azurerm_resource_group.rg.location
|
| 66 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 67 |
+
|
| 68 |
+
ip_configuration {
|
| 69 |
+
name = "internal"
|
| 70 |
+
subnet_id = azurerm_subnet.subnet.id
|
| 71 |
+
private_ip_address_allocation = "Dynamic"
|
| 72 |
+
public_ip_address_id = azurerm_public_ip.pip.id
|
| 73 |
+
}
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
resource "azurerm_network_interface_security_group_association" "nsg_assoc" {
|
| 77 |
+
network_interface_id = azurerm_network_interface.nic.id
|
| 78 |
+
network_security_group_id = azurerm_network_security_group.nsg.id
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
resource "tls_private_key" "ssh_key" {
|
| 82 |
+
algorithm = "RSA"
|
| 83 |
+
rsa_bits = 4096
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
resource "azurerm_linux_virtual_machine" "vm" {
|
| 87 |
+
name = "vm-linux-prod"
|
| 88 |
+
location = azurerm_resource_group.rg.location
|
| 89 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 90 |
+
network_interface_ids = [azurerm_network_interface.nic.id]
|
| 91 |
+
size = "Standard_B2s"
|
| 92 |
+
|
| 93 |
+
os_disk {
|
| 94 |
+
name = "osdisk-linux-vm"
|
| 95 |
+
caching = "ReadWrite"
|
| 96 |
+
storage_account_type = "StandardSSD_LRS"
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
source_image_reference {
|
| 100 |
+
publisher = "Canonical"
|
| 101 |
+
offer = "0001-com-ubuntu-server-jammy"
|
| 102 |
+
sku = "22_04-lts"
|
| 103 |
+
version = "latest"
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
computer_name = "linuxvm"
|
| 107 |
+
admin_username = "azureuser"
|
| 108 |
+
disable_password_authentication = true
|
| 109 |
+
|
| 110 |
+
admin_ssh_key {
|
| 111 |
+
username = "azureuser"
|
| 112 |
+
public_key = tls_private_key.ssh_key.public_key_openssh
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
output "public_ip_address" {
|
| 117 |
+
value = azurerm_public_ip.pip.ip_address
|
| 118 |
+
description = "The public IP address of the Linux VM."
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
output "tls_private_key" {
|
| 122 |
+
value = tls_private_key.ssh_key.private_key_pem
|
| 123 |
+
description = "The private SSH key to access the VM."
|
| 124 |
+
sensitive = true
|
| 125 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-003/main.tf
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
random = {
|
| 8 |
+
source = "hashicorp/random"
|
| 9 |
+
version = "~> 3.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
provider "azurerm" {
|
| 15 |
+
features {}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "random_string" "suffix" {
|
| 19 |
+
length = 8
|
| 20 |
+
special = false
|
| 21 |
+
upper = false
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
resource "random_password" "sql_admin" {
|
| 25 |
+
length = 16
|
| 26 |
+
special = true
|
| 27 |
+
override_special = "!#$%&*()-_=+[]{}<>:?"
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
resource "azurerm_resource_group" "main" {
|
| 31 |
+
name = "rg-sql-demo-${random_string.suffix.result}"
|
| 32 |
+
location = "eastus"
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
resource "azurerm_mssql_server" "main" {
|
| 36 |
+
name = "sqlserver-${random_string.suffix.result}"
|
| 37 |
+
resource_group_name = azurerm_resource_group.main.name
|
| 38 |
+
location = azurerm_resource_group.main.location
|
| 39 |
+
version = "12.0"
|
| 40 |
+
administrator_login = "sqladmin"
|
| 41 |
+
administrator_login_password = random_password.sql_admin.result
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
resource "azurerm_mssql_database" "main" {
|
| 45 |
+
name = "sqldb-main"
|
| 46 |
+
server_id = azurerm_mssql_server.main.id
|
| 47 |
+
sku_name = "S0"
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
resource "azurerm_mssql_firewall_rule" "allow_all" {
|
| 51 |
+
name = "AllowAllIPs"
|
| 52 |
+
server_id = azurerm_mssql_server.main.id
|
| 53 |
+
start_ip_address = "0.0.0.0"
|
| 54 |
+
end_ip_address = "255.255.255.255"
|
| 55 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-004/main.tf
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "azurerm" {
|
| 11 |
+
features {}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "azurerm_resource_group" "main" {
|
| 15 |
+
name = "rg-network-prod"
|
| 16 |
+
location = "eastus"
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
resource "azurerm_virtual_network" "main" {
|
| 20 |
+
name = "vnet-prod-eastus"
|
| 21 |
+
location = azurerm_resource_group.main.location
|
| 22 |
+
resource_group_name = azurerm_resource_group.main.name
|
| 23 |
+
address_space = ["10.0.0.0/16"]
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
resource "azurerm_subnet" "default" {
|
| 27 |
+
name = "default"
|
| 28 |
+
resource_group_name = azurerm_resource_group.main.name
|
| 29 |
+
virtual_network_name = azurerm_virtual_network.main.name
|
| 30 |
+
address_prefixes = ["10.0.0.0/24"]
|
| 31 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-005/main.tf
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "azurerm" {
|
| 11 |
+
features {}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "azurerm_resource_group" "aks_rg" {
|
| 15 |
+
name = "rg-aks-cluster"
|
| 16 |
+
location = "East US"
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
resource "azurerm_kubernetes_cluster" "aks_cluster" {
|
| 20 |
+
name = "aks-cluster-no-rbac"
|
| 21 |
+
location = azurerm_resource_group.aks_rg.location
|
| 22 |
+
resource_group_name = azurerm_resource_group.aks_rg.name
|
| 23 |
+
dns_prefix = "aksnorbac"
|
| 24 |
+
|
| 25 |
+
role_based_access_control_enabled = false
|
| 26 |
+
|
| 27 |
+
default_node_pool {
|
| 28 |
+
name = "default"
|
| 29 |
+
node_count = 2
|
| 30 |
+
vm_size = "Standard_DS2_v2"
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
identity {
|
| 34 |
+
type = "SystemAssigned"
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
network_profile {
|
| 38 |
+
network_plugin = "kubenet"
|
| 39 |
+
load_balancer_sku = "standard"
|
| 40 |
+
}
|
| 41 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-006/main.tf
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
random = {
|
| 8 |
+
source = "hashicorp/random"
|
| 9 |
+
version = "~> 3.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
provider "azurerm" {
|
| 15 |
+
features {}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "random_string" "suffix" {
|
| 19 |
+
length = 8
|
| 20 |
+
special = false
|
| 21 |
+
upper = false
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
resource "azurerm_resource_group" "rg" {
|
| 25 |
+
name = "rg-function-app-${random_string.suffix.result}"
|
| 26 |
+
location = "East US"
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
resource "azurerm_storage_account" "sa" {
|
| 30 |
+
name = "safunc${random_string.suffix.result}"
|
| 31 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 32 |
+
location = azurerm_resource_group.rg.location
|
| 33 |
+
account_tier = "Standard"
|
| 34 |
+
account_replication_type = "LRS"
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
resource "azurerm_service_plan" "asp" {
|
| 38 |
+
name = "asp-function-${random_string.suffix.result}"
|
| 39 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 40 |
+
location = azurerm_resource_group.rg.location
|
| 41 |
+
os_type = "Linux"
|
| 42 |
+
sku_name = "Y1"
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
resource "azurerm_linux_function_app" "func" {
|
| 46 |
+
name = "func-${random_string.suffix.result}"
|
| 47 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 48 |
+
location = azurerm_resource_group.rg.location
|
| 49 |
+
service_plan_id = azurerm_service_plan.asp.id
|
| 50 |
+
storage_account_name = azurerm_storage_account.sa.name
|
| 51 |
+
storage_account_access_key = azurerm_storage_account.sa.primary_access_key
|
| 52 |
+
|
| 53 |
+
site_config {
|
| 54 |
+
application_stack {
|
| 55 |
+
node_version = "18"
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
auth_settings_v2 {
|
| 60 |
+
auth_enabled = false
|
| 61 |
+
}
|
| 62 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-007/main.tf
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
random = {
|
| 8 |
+
source = "hashicorp/random"
|
| 9 |
+
version = "~> 3.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
provider "azurerm" {
|
| 15 |
+
features {
|
| 16 |
+
key_vault {
|
| 17 |
+
purge_soft_delete_on_destroy = true
|
| 18 |
+
recover_soft_deleted_key_vaults = true
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
data "azurerm_client_config" "current" {}
|
| 24 |
+
|
| 25 |
+
resource "azurerm_resource_group" "this" {
|
| 26 |
+
name = "rg-keyvault-demo"
|
| 27 |
+
location = "eastus"
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
resource "random_string" "kv_suffix" {
|
| 31 |
+
length = 8
|
| 32 |
+
special = false
|
| 33 |
+
upper = false
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
resource "azurerm_key_vault" "this" {
|
| 37 |
+
name = "kv-demo-${random_string.kv_suffix.result}"
|
| 38 |
+
location = azurerm_resource_group.this.location
|
| 39 |
+
resource_group_name = azurerm_resource_group.this.name
|
| 40 |
+
tenant_id = data.azurerm_client_config.current.tenant_id
|
| 41 |
+
sku_name = "standard"
|
| 42 |
+
soft_delete_retention_days = 7
|
| 43 |
+
purge_protection_enabled = true
|
| 44 |
+
|
| 45 |
+
network_acls {
|
| 46 |
+
default_action = "Allow"
|
| 47 |
+
bypass = "AzureServices"
|
| 48 |
+
}
|
| 49 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-008/main.tf
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "azurerm" {
|
| 11 |
+
features {}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "azurerm_resource_group" "example" {
|
| 15 |
+
name = "rg-cosmosdb-example"
|
| 16 |
+
location = "East US"
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
resource "azurerm_cosmosdb_account" "example" {
|
| 20 |
+
name = "cosmos-example-account"
|
| 21 |
+
location = azurerm_resource_group.example.location
|
| 22 |
+
resource_group_name = azurerm_resource_group.example.name
|
| 23 |
+
offer_type = "Standard"
|
| 24 |
+
kind = "GlobalDocumentDB"
|
| 25 |
+
is_virtual_network_filter_enabled = false
|
| 26 |
+
|
| 27 |
+
consistency_policy {
|
| 28 |
+
consistency_level = "Session"
|
| 29 |
+
max_interval_in_seconds = 5
|
| 30 |
+
max_staleness_prefix = 100
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
geo_location {
|
| 34 |
+
location = azurerm_resource_group.example.location
|
| 35 |
+
failover_priority = 0
|
| 36 |
+
}
|
| 37 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-009/main.tf
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "azurerm" {
|
| 11 |
+
features {}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "azurerm_resource_group" "rg" {
|
| 15 |
+
name = "rg-network-security-prod"
|
| 16 |
+
location = "eastus"
|
| 17 |
+
|
| 18 |
+
tags = {
|
| 19 |
+
Environment = "Production"
|
| 20 |
+
ManagedBy = "Terraform"
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
resource "azurerm_network_security_group" "nsg" {
|
| 25 |
+
name = "nsg-rdp-allow"
|
| 26 |
+
location = azurerm_resource_group.rg.location
|
| 27 |
+
resource_group_name = azurerm_resource_group.rg.name
|
| 28 |
+
|
| 29 |
+
security_rule {
|
| 30 |
+
name = "Allow-RDP-Inbound"
|
| 31 |
+
priority = 100
|
| 32 |
+
direction = "Inbound"
|
| 33 |
+
access = "Allow"
|
| 34 |
+
protocol = "Tcp"
|
| 35 |
+
source_port_range = "*"
|
| 36 |
+
destination_port_range = "3389"
|
| 37 |
+
source_address_prefix = "*"
|
| 38 |
+
destination_address_prefix = "*"
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
tags = {
|
| 42 |
+
Environment = "Production"
|
| 43 |
+
ManagedBy = "Terraform"
|
| 44 |
+
}
|
| 45 |
+
}
|
generated/simple/gemini-3.1-pro/az-tf-010/main.tf
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
azurerm = {
|
| 4 |
+
source = "hashicorp/azurerm"
|
| 5 |
+
version = "~> 3.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "azurerm" {
|
| 11 |
+
features {}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
variable "resource_group_name" {
|
| 15 |
+
type = string
|
| 16 |
+
description = "The name of the resource group"
|
| 17 |
+
default = "rg-acr-prod"
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
variable "location" {
|
| 21 |
+
type = string
|
| 22 |
+
description = "The Azure region to deploy resources"
|
| 23 |
+
default = "eastus"
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
variable "acr_name" {
|
| 27 |
+
type = string
|
| 28 |
+
description = "The name of the Azure Container Registry (must be globally unique and alphanumeric only)"
|
| 29 |
+
default = "acrprodregistry12345"
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
variable "acr_sku" {
|
| 33 |
+
type = string
|
| 34 |
+
description = "The SKU name of the container registry. Possible values are Basic, Standard and Premium."
|
| 35 |
+
default = "Standard"
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
resource "azurerm_resource_group" "this" {
|
| 39 |
+
name = var.resource_group_name
|
| 40 |
+
location = var.location
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
resource "azurerm_container_registry" "this" {
|
| 44 |
+
name = var.acr_name
|
| 45 |
+
resource_group_name = azurerm_resource_group.this.name
|
| 46 |
+
location = azurerm_resource_group.this.location
|
| 47 |
+
sku = var.acr_sku
|
| 48 |
+
admin_enabled = true
|
| 49 |
+
|
| 50 |
+
tags = {
|
| 51 |
+
Environment = "Production"
|
| 52 |
+
ManagedBy = "Terraform"
|
| 53 |
+
}
|
| 54 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-001/main.tf
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
google = {
|
| 4 |
+
source = "hashicorp/google"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
random = {
|
| 8 |
+
source = "hashicorp/random"
|
| 9 |
+
version = "~> 3.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "random_id" "bucket_suffix" {
|
| 15 |
+
byte_length = 4
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "google_storage_bucket" "public_bucket" {
|
| 19 |
+
name = "public-assets-${random_id.bucket_suffix.hex}"
|
| 20 |
+
location = "US"
|
| 21 |
+
uniform_bucket_level_access = true
|
| 22 |
+
public_access_prevention = "inherited"
|
| 23 |
+
force_destroy = true
|
| 24 |
+
|
| 25 |
+
versioning {
|
| 26 |
+
enabled = true
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
resource "google_storage_bucket_iam_member" "public_read" {
|
| 31 |
+
bucket = google_storage_bucket.public_bucket.name
|
| 32 |
+
role = "roles/storage.objectViewer"
|
| 33 |
+
member = "allUsers"
|
| 34 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-002/main.tf
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
google = {
|
| 4 |
+
source = "hashicorp/google"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
provider "google" {
|
| 11 |
+
project = "YOUR_PROJECT_ID"
|
| 12 |
+
region = "us-central1"
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
resource "google_compute_network" "vpc" {
|
| 16 |
+
name = "open-vpc"
|
| 17 |
+
auto_create_subnetworks = true
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
resource "google_compute_firewall" "allow_all" {
|
| 21 |
+
name = "allow-all-ingress"
|
| 22 |
+
network = google_compute_network.vpc.name
|
| 23 |
+
|
| 24 |
+
allow {
|
| 25 |
+
protocol = "all"
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
source_ranges = ["0.0.0.0/0"]
|
| 29 |
+
target_tags = ["open-ports"]
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
resource "google_compute_instance" "vm" {
|
| 33 |
+
name = "public-open-vm"
|
| 34 |
+
machine_type = "e2-medium"
|
| 35 |
+
zone = "us-central1-a"
|
| 36 |
+
|
| 37 |
+
tags = ["open-ports"]
|
| 38 |
+
|
| 39 |
+
boot_disk {
|
| 40 |
+
initialize_params {
|
| 41 |
+
image = "debian-cloud/debian-12"
|
| 42 |
+
type = "pd-standard"
|
| 43 |
+
size = 20
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
network_interface {
|
| 48 |
+
network = google_compute_network.vpc.name
|
| 49 |
+
|
| 50 |
+
access_config {
|
| 51 |
+
network_tier = "PREMIUM"
|
| 52 |
+
}
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
metadata = {
|
| 56 |
+
block-project-ssh-keys = "true"
|
| 57 |
+
}
|
| 58 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-003/main.tf
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
google = {
|
| 4 |
+
source = "hashicorp/google"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
random = {
|
| 8 |
+
source = "hashicorp/random"
|
| 9 |
+
version = "~> 3.0"
|
| 10 |
+
}
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
resource "random_id" "db_name_suffix" {
|
| 15 |
+
byte_length = 4
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "google_sql_database_instance" "postgres" {
|
| 19 |
+
name = "postgres-instance-${random_id.db_name_suffix.hex}"
|
| 20 |
+
database_version = "POSTGRES_15"
|
| 21 |
+
region = "us-central1"
|
| 22 |
+
|
| 23 |
+
settings {
|
| 24 |
+
tier = "db-custom-2-7680"
|
| 25 |
+
|
| 26 |
+
ip_configuration {
|
| 27 |
+
ipv4_enabled = true
|
| 28 |
+
|
| 29 |
+
authorized_networks {
|
| 30 |
+
name = "allow-all"
|
| 31 |
+
value = "0.0.0.0/0"
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
backup_configuration {
|
| 36 |
+
enabled = true
|
| 37 |
+
point_in_time_recovery_enabled = true
|
| 38 |
+
transaction_log_retention_days = 7
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
disk_autoresize = true
|
| 42 |
+
disk_autoresize_limit = 0
|
| 43 |
+
disk_size = 100
|
| 44 |
+
disk_type = "PD_SSD"
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
deletion_protection = true
|
| 48 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-004/main.tf
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
resource "google_compute_network" "vpc_network" {
|
| 2 |
+
name = "my-vpc-network"
|
| 3 |
+
auto_create_subnetworks = true
|
| 4 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-005/main.tf
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
variable "project_id" {
|
| 2 |
+
type = string
|
| 3 |
+
description = "The GCP project ID"
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
variable "region" {
|
| 7 |
+
type = string
|
| 8 |
+
description = "The GCP region"
|
| 9 |
+
default = "us-central1"
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
variable "zone" {
|
| 13 |
+
type = string
|
| 14 |
+
description = "The GCP zone for the cluster"
|
| 15 |
+
default = "us-central1-a"
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
provider "google" {
|
| 19 |
+
project = var.project_id
|
| 20 |
+
region = var.region
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
resource "google_compute_network" "vpc" {
|
| 24 |
+
name = "gke-vpc"
|
| 25 |
+
auto_create_subnetworks = false
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
resource "google_compute_subnetwork" "subnet" {
|
| 29 |
+
name = "gke-subnet"
|
| 30 |
+
region = var.region
|
| 31 |
+
network = google_compute_network.vpc.name
|
| 32 |
+
ip_cidr_range = "10.10.0.0/24"
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
resource "google_container_cluster" "primary" {
|
| 36 |
+
name = "abac-enabled-cluster"
|
| 37 |
+
location = var.zone
|
| 38 |
+
|
| 39 |
+
network = google_compute_network.vpc.name
|
| 40 |
+
subnetwork = google_compute_subnetwork.subnet.name
|
| 41 |
+
|
| 42 |
+
# Enable legacy ABAC authorization
|
| 43 |
+
enable_legacy_abac = true
|
| 44 |
+
|
| 45 |
+
# Best practice: remove the default node pool and manage node pools separately
|
| 46 |
+
remove_default_node_pool = true
|
| 47 |
+
initial_node_count = 1
|
| 48 |
+
|
| 49 |
+
deletion_protection = false
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
resource "google_container_node_pool" "primary_nodes" {
|
| 53 |
+
name = "primary-node-pool"
|
| 54 |
+
location = var.zone
|
| 55 |
+
cluster = google_container_cluster.primary.name
|
| 56 |
+
node_count = 1
|
| 57 |
+
|
| 58 |
+
node_config {
|
| 59 |
+
machine_type = "e2-standard-2"
|
| 60 |
+
|
| 61 |
+
oauth_scopes = [
|
| 62 |
+
"https://www.googleapis.com/auth/cloud-platform"
|
| 63 |
+
]
|
| 64 |
+
}
|
| 65 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-006/main.tf
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
google = {
|
| 4 |
+
source = "hashicorp/google"
|
| 5 |
+
version = "~> 4.0"
|
| 6 |
+
}
|
| 7 |
+
archive = {
|
| 8 |
+
source = "hashicorp/archive"
|
| 9 |
+
version = "~> 2.0"
|
| 10 |
+
}
|
| 11 |
+
random = {
|
| 12 |
+
source = "hashicorp/random"
|
| 13 |
+
version = "~> 3.0"
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
variable "project_id" {
|
| 19 |
+
type = string
|
| 20 |
+
description = "The GCP project ID"
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
variable "region" {
|
| 24 |
+
type = string
|
| 25 |
+
default = "us-central1"
|
| 26 |
+
description = "The GCP region"
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
resource "random_id" "bucket_suffix" {
|
| 30 |
+
byte_length = 8
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
resource "google_storage_bucket" "source_bucket" {
|
| 34 |
+
name = "gcf-source-${random_id.bucket_suffix.hex}"
|
| 35 |
+
location = var.region
|
| 36 |
+
project = var.project_id
|
| 37 |
+
uniform_bucket_level_access = true
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
data "archive_file" "source_zip" {
|
| 41 |
+
type = "zip"
|
| 42 |
+
source_dir = "${path.module}/function_source"
|
| 43 |
+
output_path = "${path.module}/function_source.zip"
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
resource "google_storage_bucket_object" "source_archive" {
|
| 47 |
+
name = "source-${data.archive_file.source_zip.output_md5}.zip"
|
| 48 |
+
bucket = google_storage_bucket.source_bucket.name
|
| 49 |
+
source = data.archive_file.source_zip.output_path
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
resource "google_cloudfunctions_function" "public_function" {
|
| 53 |
+
name = "public-function"
|
| 54 |
+
project = var.project_id
|
| 55 |
+
region = var.region
|
| 56 |
+
description = "Publicly accessible Cloud Function"
|
| 57 |
+
runtime = "nodejs18"
|
| 58 |
+
|
| 59 |
+
available_memory_mb = 256
|
| 60 |
+
source_archive_bucket = google_storage_bucket.source_bucket.name
|
| 61 |
+
source_archive_object = google_storage_bucket_object.source_archive.name
|
| 62 |
+
trigger_http = true
|
| 63 |
+
entry_point = "helloWorld"
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
resource "google_cloudfunctions_function_iam_member" "public_invoker" {
|
| 67 |
+
project = google_cloudfunctions_function.public_function.project
|
| 68 |
+
region = google_cloudfunctions_function.public_function.region
|
| 69 |
+
cloud_function = google_cloudfunctions_function.public_function.name
|
| 70 |
+
|
| 71 |
+
role = "roles/cloudfunctions.invoker"
|
| 72 |
+
member = "allUsers"
|
| 73 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-007/main.tf
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
google = {
|
| 4 |
+
source = "hashicorp/google"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
resource "google_bigquery_dataset" "public_dataset" {
|
| 11 |
+
dataset_id = "public_dataset"
|
| 12 |
+
friendly_name = "Public Dataset"
|
| 13 |
+
description = "Dataset with public read access"
|
| 14 |
+
location = "US"
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
resource "google_bigquery_dataset_iam_member" "public_read_access" {
|
| 18 |
+
dataset_id = google_bigquery_dataset.public_dataset.dataset_id
|
| 19 |
+
role = "roles/bigquery.dataViewer"
|
| 20 |
+
member = "allUsers"
|
| 21 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-008/main.tf
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
terraform {
|
| 2 |
+
required_providers {
|
| 3 |
+
google = {
|
| 4 |
+
source = "hashicorp/google"
|
| 5 |
+
version = "~> 5.0"
|
| 6 |
+
}
|
| 7 |
+
}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
variable "topic_name" {
|
| 11 |
+
type = string
|
| 12 |
+
description = "The name of the Pub/Sub topic"
|
| 13 |
+
default = "public-topic"
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
resource "google_pubsub_topic" "topic" {
|
| 17 |
+
name = var.topic_name
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
resource "google_pubsub_topic_iam_member" "all_users_publisher" {
|
| 21 |
+
topic = google_pubsub_topic.topic.name
|
| 22 |
+
role = "roles/pubsub.publisher"
|
| 23 |
+
member = "allUsers"
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
resource "google_pubsub_topic_iam_member" "all_users_viewer" {
|
| 27 |
+
topic = google_pubsub_topic.topic.name
|
| 28 |
+
role = "roles/pubsub.viewer"
|
| 29 |
+
member = "allUsers"
|
| 30 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-009/main.tf
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
variable "project_id" {
|
| 2 |
+
type = string
|
| 3 |
+
description = "The ID of the GCP project"
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
variable "account_id" {
|
| 7 |
+
type = string
|
| 8 |
+
description = "The service account ID"
|
| 9 |
+
default = "project-editor-sa"
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
resource "google_service_account" "sa" {
|
| 13 |
+
project = var.project_id
|
| 14 |
+
account_id = var.account_id
|
| 15 |
+
display_name = "Project Editor Service Account"
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
resource "google_project_iam_member" "sa_editor_role" {
|
| 19 |
+
project = var.project_id
|
| 20 |
+
role = "roles/editor"
|
| 21 |
+
member = "serviceAccount:${google_service_account.sa.email}"
|
| 22 |
+
}
|
generated/simple/gemini-3.1-pro/gcp-tf-010/main.tf
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
resource "google_cloud_run_v2_service" "public_service" {
|
| 2 |
+
name = "public-cloudrun-service"
|
| 3 |
+
location = "us-central1"
|
| 4 |
+
ingress = "INGRESS_TRAFFIC_ALL"
|
| 5 |
+
|
| 6 |
+
template {
|
| 7 |
+
containers {
|
| 8 |
+
image = "us-docker.pkg.dev/cloudrun/container/hello"
|
| 9 |
+
|
| 10 |
+
resources {
|
| 11 |
+
limits = {
|
| 12 |
+
cpu = "1000m"
|
| 13 |
+
memory = "512Mi"
|
| 14 |
+
}
|
| 15 |
+
}
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
resource "google_cloud_run_v2_service_iam_member" "public_access" {
|
| 21 |
+
project = google_cloud_run_v2_service.public_service.project
|
| 22 |
+
location = google_cloud_run_v2_service.public_service.location
|
| 23 |
+
name = google_cloud_run_v2_service.public_service.name
|
| 24 |
+
role = "roles/run.invoker"
|
| 25 |
+
member = "allUsers"
|
| 26 |
+
}
|