Last active
September 16, 2022 07:33
-
-
Save trobert2/65ecda4c90c45b36a3375b233d8cad04 to your computer and use it in GitHub Desktop.
Gist to get a parameter value version from a different region
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
const sdkCall: AwsSdkCall = { | |
service: 'SSM', | |
action: 'getParameter', | |
parameters: { | |
Name: '/app/lambda-handler-version-arn' | |
}, | |
region: 'us-east-1', | |
physicalResourceId: PhysicalResourceId.of(Date.now().toString()) | |
} | |
const LambdaARNValue = new AwsCustomResource( | |
this, | |
'LambdaVersionValue', | |
{ | |
resourceType: 'Custom::LambdaVersionValue', | |
onCreate: sdkCall, | |
onUpdate: sdkCall, | |
policy: AwsCustomResourcePolicy.fromSdkCalls({ | |
resources: ['*'] | |
}) | |
} | |
) | |
const LambdaVersion = Version.fromVersionArn( | |
this, | |
'LambdaFunctionArnValue', | |
LambdaARNValue.getResponseField('Parameter.Value') | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment