-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Depend on bucket and policy before configuring ELB logging #1633
Depend on bucket and policy before configuring ELB logging #1633
Comments
I found a temporary workaround but it's not perfect since I couldn't figure out a way to add // Temporary Hack (https://github.com/awslabs/aws-cdk/issues/1633)
const albResource = alb.node.findChild('Resource') as Alb.CfnLoadBalancer
const bucketResource = bucket.node.findChild('Resource') as cdk.Resource
albResource.addDependency(bucketResource) It only works because the ALB takes so long to create (from scratch) that the bucket stuff is generally done in time. I tried working up a fix but I ran into some difficulties with |
This will be much easier to fix (and much cleaner, too) once #1583 has landed. At this point we'll be able to simply register the dependency properly in the |
When access logs are enabled for an ALB, a dependency is added between the ALB and the logging bucket and it's policy to avoid a race condition where the ALB can't access the bucket. Fixes #1633
I just ran into this, any ETA on a fix? |
Hey team. Wanted to chime in as I think I found an issue with how the dependency is being placed. If the ApplicationLoadBalancer Construct gets extended and the user configures bucket access logs, this is going to create a circular dependency because of this line:
The dependency should be written as The parent ALB, if extended, will end up depending on it's own children which will then trigger the children to depend on one another. For example:
Returns the following dependencies:
|
I tried adding logging support to my VPC using the following:
When running
cdk deploy
I got an expected warning about IAM changes and the permission looks to be correct.It appears that there is a bug in the CF template which is not waiting on the bucket policy to finish completion before it attempts to add the logging in the VPC.
I confirmed this was the case by checking the CF events in the console.
The text was updated successfully, but these errors were encountered: