-
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
[aws-codepipeline-actions] Not able to use EVENTS based S3 trigger when bucketKey contains a CDK token #9554
Labels
@aws-cdk/aws-codepipeline-actions
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p1
Comments
jimistry123
added
guidance
Question that needs advice or information.
needs-triage
This issue or PR still needs to be triaged.
labels
Aug 9, 2020
Hey @jimistry123 , you're right, this is probably a miss in the construct library for To unblock yourself, you can set the var action = S3SourceAction.Builder.create()
.actionName(projectName)
.bucket(artifactsBucket)
.bucketKey(bucketKey)
.output(outputArtifact)
.trigger(S3Trigger.NONE)
.build();
artifactsBucket.onCloudTrailPutObject("some-id", OnCloudTrailBucketEventOptions.builder()
.target(new CodePipeline(pipeline))
.paths(Collections.singletonList(bucketKey))
.build()
); |
I'll work on a fix for this in the meantime. |
skinny85
added
effort/small
Small work item – less than a day of effort
p1
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Aug 10, 2020
skinny85
added a commit
to skinny85/aws-cdk
that referenced
this issue
Aug 10, 2020
…ketKey a Token We use bucketKey to differentiate between multiple source actions that observe the same bucket using trigger=Events. However, we can't do that if bucketKey is a lazy value, as Tokens can't be used as parts of identifier for the created Event. So, check for that case explicitly. Fixes aws#9554
skinny85
added a commit
to skinny85/aws-cdk
that referenced
this issue
Aug 12, 2020
…ketKey a Token We use bucketKey to differentiate between multiple source actions that observe the same bucket using trigger=Events. However, we can't do that if bucketKey is a lazy value, as Tokens can't be used as parts of identifier for the created Event. So, check for that case explicitly. Fixes aws#9554
skinny85
added a commit
to skinny85/aws-cdk
that referenced
this issue
Aug 12, 2020
…ketKey a Token We use bucketKey to differentiate between multiple source actions that observe the same bucket using trigger=Events. However, we can't do that if bucketKey is a lazy value, as Tokens can't be used as parts of identifier for the created Event. So, check for that case explicitly. Fixes aws#9554
mergify bot
pushed a commit
that referenced
this issue
Aug 13, 2020
…ketKey a Token (#9575) We use bucketKey to differentiate between multiple source actions that observe the same bucket using trigger=Events. However, we can't do that if bucketKey is a lazy value, as Tokens can't be used as parts of identifier for the created Event. So, check for that case explicitly. Fixes #9554 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-codepipeline-actions
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p1
❓ General Issue
The Question
I am trying to use
S3SourceAction
class to define a bunch of S3 sources for a Pipeline. The bucket key for the source action is determined during deployment time using a CFN custom resource. This is how I am building an object forS3SourceAction
:Now, because the S3 trigger is set to EVENTS, CDK will automatically create a corresponding CloudWatch Events rule as a dependency. I noticed that the logical ID of the CW rule will include the bucket key in it. And because of the way I am setting bucket key, the bucket key contains a CDK token during stack synthesis.
So when I try to synthesize my stack, it throws the following error:
I came across #1374 which explains why CDK does not allow to use tokens in construct ID.
So my question is - Since I have no control over the logical ID of the dependent CloudWatch Events rule, is it possible to set an event based trigger on a dynamically generated bucket key? If there is a workaround or a better way to this then that would be great.
Environment
Other information
The text was updated successfully, but these errors were encountered: