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

Fix: Deployment Principal ARNs #164

Merged
merged 27 commits into from
May 17, 2021
Merged

Conversation

korenyoni
Copy link
Member

@korenyoni korenyoni commented May 14, 2021

what

  • Add test for deployment_principal_arns
  • Fix order of nested functions when rendering bucket policy for deployment_principal_arns — otherwise an error occurs when comparing types.
  • Fix snippet: all prefixes must begin in forward slash or otherwise the bucket policy JSON will be invalid.
  • Fix snippet passing incorrect variable name.
  • Programatically fix missing leading forward slash for prefixes in Bucket Policy

(misc)

  • Fix typo in tfvars fixtures in example.
  • Add enablement toggles to all resources in example
  • Fix minimum_protocol_version being passed when it won't be honored by AWS i.e. when s3_access_log_bucket_name is true as a result of acm_certificate_arn being unset.
  • Fix default for s3_access_log_bucket_name — it is supposed to be empty and there is a check for its length in locals{} that assumes it is empty by default, but it is not empty by default.

why

  • deployment_principal_arns was not working and examples/complete was not testing for it

references

@korenyoni korenyoni requested review from a team as code owners May 14, 2021 22:26
@korenyoni korenyoni requested review from Gowiem and brcnblc and removed request for a team May 14, 2021 22:26
@korenyoni
Copy link
Member Author

/test all

@korenyoni korenyoni requested a review from Nuru May 14, 2021 22:36
jamengual
jamengual previously approved these changes May 14, 2021
Nuru
Nuru previously requested changes May 14, 2021
examples/complete/fixtures.us-east-2.tfvars Outdated Show resolved Hide resolved
examples/complete/main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
@mergify mergify bot dismissed Nuru’s stale review May 16, 2021 13:00

This Pull Request has been updated, so we're dismissing all reviews.

korenyoni and others added 2 commits May 16, 2021 09:56
… limitations of var.acm_certificate_arn being unset in variables.tf.
@korenyoni
Copy link
Member Author

/test all

@korenyoni korenyoni requested a review from Nuru May 16, 2021 14:03
@korenyoni
Copy link
Member Author

Tests are currently stuck in queued due to a GitHub Actions incident

@korenyoni
Copy link
Member Author

/test all

@korenyoni
Copy link
Member Author

Will need to remove validation due to Terraform version used in tests being too old for functions used in validation block.

korenyoni added 2 commits May 16, 2021 16:04
…form version being used in automated Terratest testing.
…/terraform-aws-cloudfront-s3-cdn into fix/deployment-principal-arns
@korenyoni
Copy link
Member Author

/test all

@korenyoni
Copy link
Member Author

/test all

@korenyoni
Copy link
Member Author

/test all

@korenyoni
Copy link
Member Author

/test all

@Nuru Nuru force-pushed the fix/deployment-principal-arns branch from 68ab714 to c286551 Compare May 17, 2021 02:48
@Nuru
Copy link
Contributor

Nuru commented May 17, 2021

/test all

Nuru
Nuru previously approved these changes May 17, 2021
@korenyoni
Copy link
Member Author

@Nuru thank you — yes it does seem better to programatically handle the leading slash and not have the user deal with it. I just fixed a couple of typos in deployment.tf

@korenyoni
Copy link
Member Author

/test all

formatlist("${local.origin_bucket.arn}%s*", each.value),
resources = distinct(flatten([
[local.origin_bucket.arn],
formatlist("${local.origin_bucket.arn}/%s*", each.value),
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a better way of ensuring the bucket policy is valid, as we're handling the slash programatically now instead of deferring it to the user.

@korenyoni korenyoni merged commit 112a53d into master May 17, 2021
@korenyoni korenyoni deleted the fix/deployment-principal-arns branch May 17, 2021 13:17
Copy link
Member

@mcalhoun mcalhoun left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

6 participants