Last active
May 27, 2022 21:52
Revisions
-
badfun renamed this gist
Nov 26, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
badfun created this gist
Nov 26, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId } from '@aws-cdk/custom-resources' /** * Secure string from Parameter store */ const getParameter = new AwsCustomResource(this, 'SsmSecureStringParameter', { onUpdate: { service: 'SSM', action: 'getParameter', parameters: { Name: this.node.tryGetContext('secureStringParameter'), WithDecryption: true, }, physicalResourceId: PhysicalResourceId.of(Date.now().toString()), }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: AwsCustomResourcePolicy.ANY_RESOURCE, }), }) const secureString = getParameter.getResponseField('Parameter.Value')