-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tags): don't propagate tags to DnsValidatedCertificate
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { ABSENT } from "@aws-cdk/assert" | ||
import "@aws-cdk/assert/jest" | ||
import * as acm from "@aws-cdk/aws-certificatemanager" | ||
import * as r53 from "@aws-cdk/aws-route53" | ||
import { Bucket } from "@aws-cdk/aws-s3" | ||
import { App, Stack } from "@aws-cdk/core" | ||
import { tagResources } from ".." | ||
|
||
test("should tag a taggable resource", () => { | ||
const app = new App() | ||
const stack = new Stack(app, "Stack") | ||
|
||
new Bucket(stack, "Bucket") | ||
|
||
tagResources(app, () => ({ | ||
TestTag: "abc", | ||
})) | ||
|
||
expect(stack).toHaveResourceLike("AWS::S3::Bucket", { | ||
Tags: [ | ||
{ | ||
Key: "TestTag", | ||
Value: "abc", | ||
}, | ||
], | ||
}) | ||
}) | ||
|
||
// See https://github.com/aws/aws-cdk/issues/14519#issuecomment-833103147 | ||
test("should not tag DnsValidatedCertificate", () => { | ||
const app = new App() | ||
const stack = new Stack(app, "Stack") | ||
|
||
new acm.DnsValidatedCertificate(stack, "Cert", { | ||
domainName: "example.com", | ||
hostedZone: new r53.HostedZone(stack, "HostedZone", { | ||
zoneName: "example.com", | ||
}), | ||
}) | ||
|
||
tagResources(app, () => ({ | ||
TestTag: "abc", | ||
})) | ||
|
||
expect(stack).toHaveResourceLike("AWS::CloudFormation::CustomResource", { | ||
// No tags. | ||
Tags: ABSENT, | ||
}) | ||
}) |
This file contains 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