This repository was archived by the owner on Jan 25, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +26
-11
lines changed
Expand file tree Collapse file tree 8 files changed +26
-11
lines changed Original file line number Diff line number Diff line change 1+ ---
12version : 2
23jobs :
4+ validate_terraform :
5+ docker :
6+ - image : hashicorp/terraform
7+ steps :
8+ - checkout
9+ - run :
10+ name : Validate Terraform Formatting
11+ command : " [ -z \" $(terraform fmt -write=false)\" ] || { terraform fmt -write=false -diff; exit 1; }"
12+
313 build :
414 machine : true
515 # Changing default working dir to the one used for the go path configuration
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ module "vault_cluster" {
3434 # This setting will create the AWS policy that allows the vault cluster to
3535 # access KMS and use this key for encryption and decryption
3636 enable_auto_unseal = true
37+
3738 auto_unseal_kms_key_arn = " ${ data . aws_kms_alias . vault-example . target_key_arn } "
3839
3940 # To make testing easier, we allow requests from any IP address here but in a production deployment, we *strongly*
@@ -70,8 +71,8 @@ data "template_file" "user_data_vault_cluster" {
7071 consul_cluster_tag_key = " ${ var . consul_cluster_tag_key } "
7172 consul_cluster_tag_value = " ${ var . consul_cluster_name } "
7273
73- kms_key_id = " ${ data . aws_kms_alias . vault-example . target_key_id } "
74- aws_region = " ${ data . aws_region . current . name } "
74+ kms_key_id = " ${ data . aws_kms_alias . vault-example . target_key_id } "
75+ aws_region = " ${ data . aws_region . current . name } "
7576 }
7677}
7778
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ data "template_file" "user_data_vault_cluster" {
7474module "security_group_rules" {
7575 source = " github.com/hashicorp/terraform-aws-consul.git//modules/consul-client-security-group-rules?ref=v0.4.0"
7676
77- security_group_id = " ${ module . vault_cluster . security_group_id } "
77+ security_group_id = " ${ module . vault_cluster . security_group_id } "
7878
7979 # To make testing easier, we allow requests from any IP address here but in a production deployment, we *strongly*
8080 # recommend you limit this to the IP address ranges of known, trusted servers inside your VPC.
Original file line number Diff line number Diff line change @@ -126,10 +126,12 @@ data "template_file" "user_data_vault_cluster" {
126126 consul_cluster_tag_key = " ${ var . consul_cluster_tag_key } "
127127 consul_cluster_tag_value = " ${ var . consul_cluster_name } "
128128 example_role_name = " ${ var . example_role_name } "
129+
129130 # Please note that normally we would never pass a secret this way
130131 # This is just for test purposes so we can verify that our example instance is authenticating correctly
131- example_secret = " ${ var . example_secret } "
132- ami_id = " ${ var . ami_id } "
132+ example_secret = " ${ var . example_secret } "
133+
134+ ami_id = " ${ var . ami_id } "
133135 }
134136}
135137
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ data "template_file" "user_data_vault_cluster" {
7979module "security_group_rules" {
8080 source = " github.com/hashicorp/terraform-aws-consul.git//modules/consul-client-security-group-rules?ref=v0.4.0"
8181
82- security_group_id = " ${ module . vault_cluster . security_group_id } "
82+ security_group_id = " ${ module . vault_cluster . security_group_id } "
8383
8484 # To make testing easier, we allow requests from any IP address here but in a production deployment, we *strongly*
8585 # recommend you limit this to the IP address ranges of known, trusted servers inside your VPC.
Original file line number Diff line number Diff line change @@ -84,4 +84,4 @@ output "consul_cluster_cluster_tag_value" {
8484
8585output "s3_bucket_arn" {
8686 value = " ${ module . vault_cluster . s3_bucket_arn } "
87- }
87+ }
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ data "template_file" "user_data_vault_cluster" {
117117module "security_group_rules" {
118118 source = " github.com/hashicorp/terraform-aws-consul.git//modules/consul-client-security-group-rules?ref=v0.4.0"
119119
120- security_group_id = " ${ module . vault_cluster . security_group_id } "
120+ security_group_id = " ${ module . vault_cluster . security_group_id } "
121121
122122 # To make testing easier, we allow requests from any IP address here but in a production deployment, we *strongly*
123123 # recommend you limit this to the IP address ranges of known, trusted servers inside your VPC.
Original file line number Diff line number Diff line change @@ -249,15 +249,17 @@ data "aws_iam_policy_document" "vault_s3" {
249249}
250250
251251data "aws_iam_policy_document" "vault_auto_unseal_kms" {
252- count = " ${ var . enable_auto_unseal ? 1 : 0 } "
252+ count = " ${ var . enable_auto_unseal ? 1 : 0 } "
253253
254254 statement {
255- effect = " Allow"
255+ effect = " Allow"
256+
256257 actions = [
257258 " kms:Encrypt" ,
258259 " kms:Decrypt" ,
259- " kms:DescribeKey"
260+ " kms:DescribeKey" ,
260261 ]
262+
261263 resources = [" ${ var . auto_unseal_kms_key_arn } " ]
262264 }
263265}
You can’t perform that action at this time.
0 commit comments