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: only create referer password when needed #159

Closed
wants to merge 2 commits into from

Conversation

syphernl
Copy link
Contributor

what

  • Only generate the random referer when website functionality is being used.

why

  • To prevent unnecessary resources that are are not always required.

references

@syphernl syphernl requested review from a team as code owners May 12, 2021 06:54
Nuru
Nuru previously requested changes May 12, 2021
Copy link
Contributor

@Nuru Nuru left a comment

Choose a reason for hiding this comment

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

This partly conflicts with #160. I will add this functionality to #160 instead of trying to merge this. I hope you don't mind, @syphernl

main.tf Outdated Show resolved Hide resolved
@@ -81,7 +83,7 @@ data "aws_iam_policy_document" "origin_website" {
condition {
test = "StringEquals"
variable = "aws:referer"
values = [random_password.referer.result]
values = [random_password.referer[0].result]
Copy link
Member

@nitrocode nitrocode May 12, 2021

Choose a reason for hiding this comment

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

This will fail if module.this.enabled = true and var.website_enabled = false because random_password.referer[0] will not exist

You'll need to use a dynamic "condition" instead

Co-authored-by: nitrocode <[email protected]>
@mergify mergify bot dismissed Nuru’s stale review May 12, 2021 18:12

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

@Nuru
Copy link
Contributor

Nuru commented May 12, 2021

Superseded by #160

@Nuru Nuru closed this May 12, 2021
@Nuru Nuru mentioned this pull request May 12, 2021
@syphernl syphernl deleted the fix/referer branch May 12, 2021 19:36
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.

3 participants