class PhysicalResourceId
Language | Type name |
---|---|
.NET | Amazon.CDK.CustomResources.PhysicalResourceId |
Go | github.com/aws/aws-cdk-go/awscdk/v2/customresources#PhysicalResourceId |
Java | software.amazon.awscdk.customresources.PhysicalResourceId |
Python | aws_cdk.custom_resources.PhysicalResourceId |
TypeScript (source) | aws-cdk-lib » custom_resources » PhysicalResourceId |
Physical ID of the custom resource.
Example
const getParameter = new cr.AwsCustomResource(this, 'AssociateVPCWithHostedZone', {
onCreate: {
assumedRoleArn: 'arn:aws:iam::OTHERACCOUNT:role/CrossAccount/ManageHostedZoneConnections',
service: 'Route53',
action: 'AssociateVPCWithHostedZone',
parameters: {
HostedZoneId: 'hz-123',
VPC: {
VPCId: 'vpc-123',
VPCRegion: 'region-for-vpc',
},
},
physicalResourceId: cr.PhysicalResourceId.of('${vpcStack.SharedVpc.VpcId}-${vpcStack.Region}-${PrivateHostedZone.HostedZoneId}'),
},
//Will ignore any resource and use the assumedRoleArn as resource and 'sts:AssumeRole' for service:action
policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE,
}),
});
Properties
Name | Type | Description |
---|---|---|
id? | string | Literal string to be used as the physical id. |
response | string | Path to a response data element to be used as the physical id. |
id?
Type:
string
(optional)
Literal string to be used as the physical id.
responsePath?
Type:
string
(optional)
Path to a response data element to be used as the physical id.
Methods
Name | Description |
---|---|
static from | Extract the physical resource id from the path (dot notation) to the data in the API call response. |
static of(id) | Explicit physical resource id. |
static fromResponse(responsePath)
public static fromResponse(responsePath: string): PhysicalResourceId
Parameters
- responsePath
string
Returns
Extract the physical resource id from the path (dot notation) to the data in the API call response.
static of(id)
public static of(id: string): PhysicalResourceId
Parameters
- id
string
Returns
Explicit physical resource id.