feat(events): better modeling of CW Event Targets#2576
Merged
Conversation
WE used to have this because we couldn't validate what tokens returned previously, but now that we have PostProcessingToken we can!
4 tasks
eladb
approved these changes
May 20, 2019
This was referenced Aug 22, 2019
This was referenced Dec 12, 2019
This was referenced Jan 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move new event targets into
@aws-cdk/aws-events-targetsInvocation payloads are now under the control of the target classes, so
that targets for which the payload maps onto API calls (such as ECS,
CodeBuild, etc) can specify the API parameters directly as props.
EventTargetInputis a union class with three variants, allowingserialization of strings, multiline strings and objects. Target inputs
support a special type of Token (
EventField) which can be used torefer to fields from the event, instead of value literals. A number of
predefined events and the fields that they have available have been
defined, so that accessing them becomes even more convenient
(
StageChangeEvent,PhaseChangeEvent,ReferenceEvent).To be able to use Tokens to implement EventInput substitution, add a
refactoring and more principaled separation of concerns in the Token
code. Resolution can now be more easily hooked, CloudFormation-aware
string concatenation is implemented using a plugin, and Token callbacks
receive an
IResolveContextwhich they can use to resolve deeper (andwill reuse the same settings that the resolver was started with). We
should as good as be able to get rid of
stack.node.resolve()in thenear future.
ALSO:
LatestDeploymentResourceto use existing logical IDoverriding features.
onEvent()method toCloudTrail.rendering would lead to stateful side effects. Make Actions render
out their region directly, if set, without requiring overrides.
assignPublicIpnow defaults toundefined, insteadof
DISABLED, to align with service API.CfnReferenceobjects upon resolution would fail to be detectedduring cross-stack reference analysis;
CfnReferencenow hasstatic methods that return singleton objects.
CfnResource.toCloudFormation(). We can now usePostProcessTokento apply the property renames and output validation we were originally
doing the resolve for.
Fixes #2403, fixes #2404, fixes #2581.
BREAKING CHANGES
@aws-cdk/aws-codepipeline.Pipelineis no longer an event targetitself, use
@aws-cdk/aws-events-targets.CodePipelineinstead.@aws-cdk/aws-stepfunctions.StateMachineis no longer an event targetitself, use
@aws-cdk/aws-events-targets.SfnStateMachineinstead.@aws-cdk/aws-ecs.Ec2RunTaskhas been renamed to@aws-cdk/aws-events-targets.EcsEc2Task.CloudFormationJSON.stringify()is now renamed toCloudFormationLang.toJSON().Pull Request Checklist
designfolderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.