From c026b8404bd00be3e3cfb592a38bf238fbcd2527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 31 Jul 2019 10:26:24 -0400 Subject: [PATCH] narrow down permissions of deploy user policy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- modules/aws-eb-env/access.tf | 81 ++++++++++++++++++++++++++++++++++++ modules/aws-eb-env/main.tf | 8 ++-- 2 files changed, 86 insertions(+), 3 deletions(-) diff --git a/modules/aws-eb-env/access.tf b/modules/aws-eb-env/access.tf index 0b2014a..e649133 100644 --- a/modules/aws-eb-env/access.tf +++ b/modules/aws-eb-env/access.tf @@ -25,3 +25,84 @@ resource "aws_iam_group_policy_attachment" "deploy" { group = aws_iam_group.deploy.name policy_arn = "arn:aws:iam::aws:policy/AWSElasticBeanstalkFullAccess" } + +/* This doesn't work right now, needs improvement */ +//data "aws_region" "current" {} +//data "aws_caller_identity" "current" {} +//data "aws_iam_user" "deploy" { +// user_name = aws_iam_user.deploy.name +//} +// +///* shorthands for neater templating */ +//locals { +// region = data.aws_region.current.name +// account_id = data.aws_caller_identity.current.account_id +// instance_profile = module.eb_environment.ec2_instance_profile_role_name +// full_app_name = "${var.stage}-${local.app_name}" +//} +// +///* Source: https://gist.github.com/magnetikonline/5034bdbb049181a96ac9 */ +//resource "aws_iam_group_policy" "deploy" { +// name = "${var.name}-deploy-policy" +// group = aws_iam_group.deploy.name +// +// policy = <