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

set enabled for codebuild module #100

Merged
merged 9 commits into from
Oct 19, 2022

Conversation

mihaiplesa
Copy link
Contributor

@mihaiplesa mihaiplesa commented Oct 14, 2022

what

  • currently CodePipeline resources are created even if we set enabled to false

why

  • we'd like to not create CodePipeline resources when enabled is false

references

@joe-niland
Copy link
Sponsor Member

/test all

@mihaiplesa
Copy link
Contributor Author

@joe-niland can we try tests again?

@joe-niland
Copy link
Sponsor Member

/test all

@mihaiplesa
Copy link
Contributor Author

Ok, should work now @joe-niland.

@joe-niland
Copy link
Sponsor Member

/test all

@joe-niland
Copy link
Sponsor Member

@mihaiplesa let's check that, but I think the test is going to keep failing due to duplicate bucket name. I'm looking at fixing the test now.

@mihaiplesa
Copy link
Contributor Author

mihaiplesa commented Oct 14, 2022

I've tested with cloudposse/terraform-aws-ecs-web-app@master...mihaiplesa:terraform-aws-ecs-web-app:master and setting codebuild_enabled to false.

One last possible change would be to replace [0] with .*..

main.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
Co-authored-by: Joe Niland <joe@originalmind.com.au>
@joe-niland
Copy link
Sponsor Member

/test terratest

@mihaiplesa
Copy link
Contributor Author

mihaiplesa commented Oct 14, 2022

Ugh, for using aws_s3_bucket_acl we need AWS provider v4 and this module has >= 2.0 so we'd break compatibility if we merge this. Similar in https://github.com/cloudposse/terraform-aws-codebuild.

Can we just merge without aws_s3_bucket_acl if the only broken tests are because of the deprecation warning?

@joe-niland
Copy link
Sponsor Member

@mihaiplesa yes, we can leave the deprecation warning in for this one. If you want to revert that, let's try again.

@mihaiplesa
Copy link
Contributor Author

@joe-niland done.

@joe-niland
Copy link
Sponsor Member

/test all

@mihaiplesa mihaiplesa requested review from joe-niland and removed request for korenyoni October 14, 2022 10:17
@joe-niland
Copy link
Sponsor Member

@mihaiplesa all your issues are OK now, but the tests are still failing due to a bucket name collision. I'm fixing that in this PR but needs an approval before merging.

@joe-niland
Copy link
Sponsor Member

@mihaiplesa can you please merge master and then we'll try it again?

@mihaiplesa
Copy link
Contributor Author

@joe-niland done.

@joe-niland
Copy link
Sponsor Member

/test terratest

@joe-niland
Copy link
Sponsor Member

/test bats

@joe-niland
Copy link
Sponsor Member

/test readme

@joe-niland joe-niland added the minor New features that do not break anything label Oct 19, 2022
@joe-niland joe-niland merged commit 229e636 into cloudposse:master Oct 19, 2022
@joe-niland
Copy link
Sponsor Member

Thanks @mihaiplesa we got there in the end!

@mihaiplesa mihaiplesa deleted the mplesa-codebuild-enabled-set branch October 19, 2022 13:22
@mihaiplesa
Copy link
Contributor Author

Thank you as well. This is where it will actually be used cloudposse/terraform-aws-ecs-web-app#210

@nitrocode
Copy link
Member

@joe-niland This change seems like a no-op.

For future ref: The change here passed in enabled = module.this.enabled but this is already passed in via the context.

https://github.com/mihaiplesa/terraform-aws-ecs-codepipeline/blob/f2b43ffedc30a7f4f7f57b59f9020b79fb3f8a83/main.tf#L239

@mihaiplesa please use the PR template.

If the above functionality does not have the intended effect without applying this change, then something else is very wrong...

@joe-niland
Copy link
Sponsor Member

joe-niland commented Oct 19, 2022

@nitrocode thanks, I can see that now.

@mihaiplesa I should have asked you which codebuild resources were created when enabled == false. Could you let us know if you still see the original issue?

@mihaiplesa
Copy link
Contributor Author

Hmm I can't reproduce now which seems to be reassuring, it's been a while since this issue has been on my mind so I might be mixing things.

Also noticed now that module.this.enabled if only passed where there is a count or a more complex conditional.

Do we want to revert this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor New features that do not break anything
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resources created when enabled set to false
4 participants