Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example of infrastructure repo with terraform, ansible and continuous delivery

License

NotificationsYou must be signed in to change notification settings

tldr-devops/infrastructure-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This example was conceived as an infrastructure for one AWS account with one region and division into dev, management and prod environments.But it can be extended for multiple regions, aws accounts and other clouds.

Current files structure:

ansible/ansible.cfgansible/group_vars/all.ymlansible/inventoryansible/playbooks/users.ymlansible/roles/users/README.mdansible/roles/users/defaults/main.ymlansible/roles/users/handlers/main.ymlansible/roles/users/tasks/main.ymlterraform/environments/aws-account-id/backend.hclterraform/environments/aws-account-id/global/management/.gitkeepterraform/environments/aws-account-id/us-east-2/dev/ec2/instance/example/main.tfterraform/environments/aws-account-id/us-east-2/dev/ec2/instance/example/output.tfterraform/environments/aws-account-id/us-east-2/dev/ec2/instance/example/terragrunt.hclterraform/environments/aws-account-id/us-east-2/dev/ec2/instance/example/variables.tfterraform/environments/aws-account-id/us-east-2/dev/vpc/default/main.tfterraform/environments/aws-account-id/us-east-2/dev/vpc/default/output.tfterraform/environments/aws-account-id/us-east-2/dev/vpc/default/terragrunt.hclterraform/environments/aws-account-id/us-east-2/management/ec2/key_pair/terraform/main.tfterraform/environments/aws-account-id/us-east-2/management/ec2/key_pair/terraform/terragrunt.hclterraform/environments/aws-account-id/us-east-2/management/s3/terraform_state/main.tfterraform/environments/aws-account-id/us-east-2/management/s3/terraform_state/output.tfterraform/environments/aws-account-id/us-east-2/management/s3/terraform_state/terragrunt.hclterraform/environments/aws-account-id/us-east-2/management/vpc/default/main.tfterraform/environments/aws-account-id/us-east-2/management/vpc/default/terragrunt.hclterraform/environments/aws-account-id/us-east-2/prod/vpc/default/main.tfterraform/environments/aws-account-id/us-east-2/prod/vpc/default/terragrunt.hclterraform/environments/aws-account-id/us-east-2/region.hclterraform/environments/terragrunt.hclterraform/modules/aws/ec2/ami/main.tfterraform/modules/aws/ec2/ami/outputs.tfterraform/modules/aws/ec2/ami/variables.tfterraform/modules/aws/ec2/terraform_key_pair/main.tf

Time track:

In this setup I use terraform with terragrunt for provisioning whole infrastructure.Terraform can store it's state in files or in remote backend via S3 orTerraform Cloud.For command work we should use only remote state. In this setup I use AWS S3terraform_state bucket + DynamoDB for locking.This require some initial preparation:

cd terraform/environments/aws-account-id/us-east-2/management/s3/terraform_state/terraform initterraform applysed -i "s/terraform_state_bucket/$(terraform output terraform_state_s3_bucket_name|sed 's/\"//g')/g" ../../../../backend.hclterragrunt init

Resources

About

Example of infrastructure repo with terraform, ansible and continuous delivery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp