Skip to content
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

fix(aws-kms): export of encryption key ref #1036

Merged
merged 1 commit into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/@aws-cdk/aws-kinesis/test/test.stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,12 @@ export = {
},
"Outputs": {
"MyStreamKeyKeyArn967BCB03": {
"Value": {
"Fn::GetAtt": [
"MyStreamKey76F3300E",
"Arn"
]
},
"Export": {
"Name": "MyStreamKeyKeyArn967BCB03"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-kms/lib/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export abstract class EncryptionKeyRef extends Construct {
*/
public export(): EncryptionKeyRefProps {
return {
keyArn: new Output(this, 'KeyArn').makeImportValue().toString()
keyArn: new Output(this, 'KeyArn', { value: this.keyArn }).makeImportValue().toString()
};
}
}
Expand Down
42 changes: 24 additions & 18 deletions packages/@aws-cdk/aws-kms/test/test.key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,29 +304,35 @@ export = {

expect(stack1).toMatch({
Resources: {
MyKey6AB29FA6: {
Type: "AWS::KMS::Key",
Properties: {
KeyPolicy: {
Statement: [
{
Effect: "Allow",
Resource: "*"
}
],
Version: "2012-10-17"
MyKey6AB29FA6: {
Type: "AWS::KMS::Key",
Properties: {
KeyPolicy: {
Statement: [
{
Effect: "Allow",
Resource: "*"
}
],
Version: "2012-10-17"
}
},
DeletionPolicy: "Retain"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation fixes

}
},
DeletionPolicy: "Retain"
}
},
Outputs: {
MyKeyKeyArn317F1332: {
Export: {
Name: "MyKeyKeyArn317F1332"
MyKeyKeyArn317F1332: {
Value: {
"Fn::GetAtt": [
"MyKey6AB29FA6",
"Arn"
]
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the value is tested

Export: {
Name: "MyKeyKeyArn317F1332"
}
}
}
}
});

const stack2 = new Stack();
Expand Down