feat: Move the data bucket into the GuCDK stack #622
Merged
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.
Builds on #598.
What does this change?
Migrates the
AmigoDataBucket
resource into the GuCDK version of the stack.In order to do this, we need to also move any resource that references
AmigoDataBucket
. There's only one resourceAmigoAppPolicy
.Whilst we could migrate
AmigoAppPolicy
in this change too, it's preferable not to as the change set is pretty big and difficult to reason about.I couldn't work out how to mutate a YAML defined resource from within CDK, so instead an additional policy is being added. I plan to migrate the remaining policies defined in
AmigoAppPolicy
to it in the next PR.One thing to note is the bucket name is "changing" from a
Fn::Sub
to a mapping lookup, it still resolves to the same value. This causescdk diff
(via./script/diff
) to suggest this is a replacement operation:However it really isn't, as seen in the JSON change set below - there are only
AWS::IAM::Policy
changes. (Technically, thegu:cdk:version
tag also updates as the library version has been bumped, however I applied that separately as it's a no-op).Change set JSON from CODE
I think
cdk
simply follows the Cloudformation spec:Lastly
@guardian/cdk
gets updated to 19.3.0 to get the newGuS3Bucket
construct (guardian/cdk#635).How to test
Deploy this branch to CODE, we should still be able to list the packages installed during a bake.
How can we measure success?
We move closer to a CDK only template.