Skip to content

Commit

Permalink
Add Vault only changes required for CloudWatch (#129)
Browse files Browse the repository at this point in the history
* Add vault only changes

* Add missing required perm
  • Loading branch information
guangie88 authored Jun 19, 2018
1 parent fb9aedf commit aff5a69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion environments/staging/vault/aws_auth.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "aws_auth" {
vault_iam_role_arn = "${data.terraform_remote_state.core.vault_iam_role_arn}"

aws_auth_path = "${local.aws_path}"
base_policies = ["${vault_policy.child_tokens.name}"]
base_policies = ["${vault_policy.child_tokens.name}", "${vault_policy.aws_sts_telegraf.name}"]
consul_policies = []
nomad_server_policies = ["${module.nomad_vault_integration.nomad_server_policy_name}"]
nomad_client_policies = ["${module.docker_auth.policy}"]
Expand Down
4 changes: 3 additions & 1 deletion environments/staging/vault/aws_secret.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ data "aws_iam_policy_document" "vault_iam" {

values = [
"arn:aws:iam::aws:policy/AmazonEC2FullAccess",
"${aws_iam_policy.telegraf.arn}",
]
}
}
Expand Down Expand Up @@ -311,6 +312,7 @@ data "aws_iam_policy_document" "telegraf" {
sid = "GetListMetrics"

actions = [
"cloudwatch:GetMetricData",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics",
]
Expand All @@ -336,7 +338,7 @@ resource "vault_aws_secret_backend_role" "telegraf" {
backend = "${vault_aws_secret_backend.aws.path}"
name = "${local.telegraf_role_name}"

policy = "${data.aws_iam_policy_document.telegraf.json}"
policy_arn = "${aws_iam_policy.telegraf.arn}"
}

data "template_file" "aws_sts_telegraf" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
path "${aws_sts_path}/sts/${telegraf_role_name}" {
capabilities = ["create", "update"]
path "${aws_sts_path}/creds/${telegraf_role_name}" {
capabilities = ["read"]
}

0 comments on commit aff5a69

Please sign in to comment.