Skip to content

Commit

Permalink
Merge pull request #44 from sundeepkovo/adding-configurable-groups
Browse files Browse the repository at this point in the history
NO-TICKET Allow user group to be configurable.
  • Loading branch information
sundeepkovo authored Mar 29, 2021
2 parents f31a632 + ee3e22c commit e699777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ string | `quay.io/turner/turner-defaultbackend:0.2.0` | no |
| tags | Tags for the infrastructure | map | - | yes |
| datadog_tags | Tags for datadog agent container. <sup>(1)</sup> Please add `team:team-name` to datadog tags | string | - | yes<sup>(1)</sup> |
| vpc | The VPC to use for the Fargate cluster | string | - | yes |
| additional_user_groups | Any additional groups the user should belong to that's used for deploying your fargate app. | list(string) | [] | no |
| enable_datadog_log_forwarding| Should enable data dog log forwarding. datadog_api_key_from must also be set for this to be enabled. You may need to modify task_memory, task_cpu, container_memory, container_cpu to account for this new container being added. | bool | false | no
## Outputs

Expand Down
14 changes: 7 additions & 7 deletions cicd.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# create ci/cd user with access keys (for build system)
variable "ecr_repository_arn" {}

variable "additional_user_groups" {
default = []
}

resource "aws_iam_user" "cicd" {
name = "srv_${var.app}_${var.environment}_cicd"
}
Expand All @@ -9,14 +13,10 @@ resource "aws_iam_group" "cicd" {
name = "srv_${var.app}_${var.environment}_cicd"
}

resource "aws_iam_group_membership" "cicd" {
name = "srv_${var.app}_${var.environment}_cicd_group_membership"

users = [
aws_iam_user.cicd.name
]
resource "aws_iam_user_group_membership" "cicd" {
user = aws_iam_user.cicd.name

group = aws_iam_group.cicd.name
groups = concat([aws_iam_group.cicd.name], var.additional_user_groups)
}

# grant required permissions to deploy
Expand Down

0 comments on commit e699777

Please sign in to comment.