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 crossAccountRoleArn = 'arn:aws:iam::OTHERACCOUNT:role/CrossAccountRoleName'; // arn of role deployed in separate account
const callRegion = 'us-west-1'; // sdk call to be made in specified region (optional)
new cr.AwsCustomResource(this, 'CrossAccount', {
onCreate: {
assumedRoleArn: crossAccountRoleArn,
region: callRegion, // optional
service: 'sts',
action: 'GetCallerIdentity',
physicalResourceId: cr.PhysicalResourceId.of('id'),
},
policy: cr.AwsCustomResourcePolicy.fromStatements([iam.PolicyStatement.fromJson({
Effect: "Allow",
Action: "sts:AssumeRole",
Resource: crossAccountRoleArn,
})]),
});
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.

.NET
Go
Java
Python
TypeScript (