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

docs(custom-resource): add example for AwsApiCall #26621

Merged
merged 10 commits into from
Aug 10, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,41 @@ export class PhysicalResourceId {

/**
* An AWS SDK call.
*
* @example
*
* // In AWS SDK for JavaScript v2
* new cr.AwsCustomResource(this, 'GetParameterV2', {
* onUpdate: { // will also be called for a CREATE event
* service: 'SSM',
* action: 'getParameter',
* parameters: {
* Name: 'my-parameter',
* WithDecryption: true,
* },
* physicalResourceId: cr.PhysicalResourceId.fromResponse('Parameter.ARN'),
* },
* policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
* resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE,
* }),
* });
*
* // In AWS SDK for JavaScript v3
* new cr.AwsCustomResource(this, 'GetParameterV3', {
* onUpdate: {
* service: '@aws-sdk/client-ssm', // 'SSM' in v2
* action: 'GetParameterCommand', // 'getParameter' in v2
* parameters: {
* Name: 'my-parameter',
* WithDecryption: true,
* },
* physicalResourceId: cr.PhysicalResourceId.fromResponse('Parameter.ARN'),
* },
* policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
* resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE,
* }),
* });
*
*/
export interface AwsSdkCall {
/**
Expand Down
Loading