This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_dynamodb_table" "terraform_state_lock" { | |
name = "terraform-lock" | |
read_capacity = 5 | |
write_capacity = 5 | |
hash_key = "LockID" | |
billing_mode = "PAY_PER_REQUEST" | |
attribute { | |
name = "LockID" | |
type = "S" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# S3 Bucket Used by the Terraform State Management | |
# Must be initialized first prior to uncommiting the configuration for terraform | |
resource "aws_s3_bucket" "devsecops-bc-state" { | |
bucket = "devsecops-bc-state" | |
versioning { | |
enabled = true | |
} | |
server_side_encryption_configuration { | |
rule { | |
apply_server_side_encryption_by_default { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# State Module | |
module "state" { | |
source = ".//modules/state" | |
} | |
# Configure Terraform to push production state to an S3 bucket. | |
terraform { | |
backend "s3" { | |
bucket = "<name of your bucket>" | |
key = "terraform.state" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "127.0.0.1 AWSVC009 AWSVC009" >> /etc/hosts | |
yum update -y | |
wget https://packages.chef.io/stable/el/5/chef-server-core-12.6.0-1.el5.x86_64.rpm | |
rpm -Uvh chef-server-core-12.6.0-1.el5.x86_64.rpm | |
chef-server-ctl reconfigure | |
mkdir /home/ec2-user/cookbooks | |
chown ec2-user /home/ec2-user/cookbooks | |
mkdir /home/ec2-user/.chef | |
chown ec2-user /home/ec2-user/.chef |