1
1
# Require TF version to be same as or greater than 0.12.16
2
2
terraform {
3
3
required_version = " >=0.12.16"
4
+ /*
4
5
backend "s3" {
5
6
bucket = "kyler-codebuild-demo-terraform-tfstate"
6
7
key = "terraform.tfstate"
7
8
region = "us-east-1"
8
9
dynamodb_table = "codebuild-dynamodb-terraform-locking"
9
10
encrypt = true
10
11
}
12
+ */
11
13
}
12
14
13
15
# Download any stable version in AWS provider of 2.36.0 or higher in 2.36 train
14
16
provider "aws" {
15
17
region = " us-east-1"
16
18
version = " ~> 2.36.0"
19
+ /*
17
20
assume_role {
18
21
# Remember to update this account ID to yours
19
22
role_arn = "arn:aws:iam::718626770228:role/TerraformAssumedIamRole"
20
23
session_name = "terraform"
21
24
}
25
+ */
22
26
}
23
27
24
-
25
- # # Step 1: Build an IAM user with administrative rights
26
- # Export the access key and secret access key into global bash variables. The commands will look like this:
27
- # export AWS_ACCESS_KEY_ID="AKIA2OULU2K4324HLYFNU"
28
- # export AWS_SECRET_ACCESS_KEY="b8ma12345678901234567890toWCOjo"
29
-
30
-
31
- # # Step 2: Build an S3 bucket and DynamoDB for Terraform state and locking
28
+ # # Build an S3 bucket and DynamoDB for Terraform state and locking
32
29
module "bootstrap" {
33
30
source = " ./modules/bootstrap"
34
31
s3_tfstate_bucket = " kyler-codebuild-demo-terraform-tfstate"
@@ -40,14 +37,13 @@ module "bootstrap" {
40
37
tf_codepipeline_artifact_bucket_arn = module. codepipeline . tf_codepipeline_artifact_bucket_arn
41
38
}
42
39
43
- # # Step 3: Build a CodeCommit git repo
40
+ # # Build a CodeCommit git repo
44
41
module "codecommit" {
45
42
source = " ./modules/codecommit"
46
43
repository_name = " CodeCommitTerraform"
47
44
}
48
45
49
-
50
- # # Step 4: Build CodeBuild projects for Terraform Plan and Terraform Apply
46
+ # # Build CodeBuild projects for Terraform Plan and Terraform Apply
51
47
module "codebuild" {
52
48
source = " ./modules/codebuild"
53
49
codebuild_project_terraform_plan_name = " TerraformPlan"
@@ -57,8 +53,7 @@ module "codebuild" {
57
53
s3_logging_bucket = module. bootstrap . s3_logging_bucket
58
54
}
59
55
60
-
61
- # # Step 5: Build a CodePipeline
56
+ # # Build a CodePipeline
62
57
module "codepipeline" {
63
58
source = " ./modules/codepipeline"
64
59
tf_codepipeline_name = " TerraformCodePipeline"
0 commit comments