Skip to content

Instantly share code, notes, and snippets.

@trobert2
Last active September 16, 2022 07:33
Show Gist options
  • Save trobert2/65ecda4c90c45b36a3375b233d8cad04 to your computer and use it in GitHub Desktop.
Save trobert2/65ecda4c90c45b36a3375b233d8cad04 to your computer and use it in GitHub Desktop.
Gist to get a parameter value version from a different region
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