Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only create IAM policy document when principals are provided #41

Closed
wants to merge 1 commit into from

Conversation

ecstasy2
Copy link

@ecstasy2 ecstasy2 commented Nov 3, 2021

what

  • Only attempt to create the iam policy document when at least one of the allowed principal types are provided.

why

  • Currently, not passing any of the two principal types causes the module to fail

@ecstasy2 ecstasy2 requested review from a team as code owners November 3, 2021 04:08
@nitrocode
Copy link
Member

/test all

@@ -4,6 +4,8 @@ locals {
enabled = module.this.enabled

kms_key_id = local.enabled && var.encryption_enabled && var.kms_master_key_id != "" ? var.kms_master_key_id : ""

create_iam_policy = module.this.enabled && (length(var.allowed_aws_services_for_sns_published) > 0 || length(var.allowed_iam_arns_for_sns_publish) > 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if any of these inputs are not present at plan time, this module will fail to provision

@mergify
Copy link

mergify bot commented Nov 17, 2021

This pull request is now in conflict. Could you fix it @ecstasy2? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants