PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #terraform tag
Create reusable Terraform module for multi-cloud deployment (AWS/Azure). Features: 1. Networking layer (VPC/VNet). 2. Variables for customization (instance types, regions). 3. State management with remote backend (S3/Blob). 4. Security groups and firewall rules. 5. Load balancer configuration. 6. Output values for connection strings. 7. Terratest scripts for validation. 8. Documentation with input/output tables. Include conditional resource creation logic.
Provision AWS infrastructure using Terraform. Resources to create: 1. VPC with public and private subnets across 3 AZs. 2. ECS Fargate cluster for containerized apps. 3. RDS PostgreSQL with Multi-AZ and automated backups. 4. Application Load Balancer with SSL certificate. 5. S3 bucket for static assets with CloudFront CDN. 6. IAM roles and security groups with least privilege. Use modules for reusability, remote state in S3, and workspaces for environments. Include cost estimation and tagging strategy.
Write a basic Terraform configuration (`main.tf`) to provision an AWS S3 bucket. The configuration should specify the AWS provider, a resource for the S3 bucket, and a unique bucket name. Include a variable for the AWS region.
Implement Infrastructure as Code using Terraform for scalable, repeatable infrastructure provisioning. Terraform best practices: 1. Module structure: reusable components, input variables, output values, documentation. 2. State management: remote backends (S3 + DynamoDB), state locking, team collaboration. 3. Version control: semantic versioning for modules, branch protection, code reviews. 4. Testing: terraform plan validation, terratest for integration testing. Multi-environment strategy: 1. Workspace separation: dev, staging, production with environment-specific variables. 2. Configuration management: tfvars files, environment variable injection. 3. Deployment pipeline: automated testing, approval workflows, drift detection. Resource provisioning: 1. Cloud provider modules: AWS VPC, EC2, RDS with appropriate sizing and security groups. 2. Networking: subnets, route tables, NAT gateways, VPN connections. 3. Security: IAM roles, security groups, encryption at rest/transit. Cost optimization: 1. Resource tagging: cost allocation, environment identification, automated cleanup. 2. Right-sizing: instance types based on performance requirements, reserved instances for predictable workloads. Security scanning: Checkov, tfsec for policy compliance, secret detection, vulnerability assessment. Documentation: README files, module documentation, architecture diagrams.