PhysicalResourceId

class aws_cdk.custom_resources.PhysicalResourceId(*args: Any, **kwargs)

Bases: object

Physical ID of the custom resource.

ExampleMetadata:

infused

Example:

get_parameter = cr.AwsCustomResource(self, "AssociateVPCWithHostedZone",
    on_create=cr.AwsSdkCall(
        assumed_role_arn="arn:aws:iam::OTHERACCOUNT:role/CrossAccount/ManageHostedZoneConnections",
        service="Route53",
        action="AssociateVPCWithHostedZone",
        parameters={
            "HostedZoneId": "hz-123",
            "VPC": {
                "VPCId": "vpc-123",
                "VPCRegion": "region-for-vpc"
            }
        },
        physical_resource_id=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.from_sdk_calls(
        resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
    )
)

Attributes

id

Literal string to be used as the physical id.

response_path

Path to a response data element to be used as the physical id.

Static Methods

classmethod from_response(response_path)

Extract the physical resource id from the path (dot notation) to the data in the API call response.

Parameters:

response_path (str) –

Return type:

PhysicalResourceId

classmethod of(id)

Explicit physical resource id.

Parameters:

id (str) –

Return type:

PhysicalResourceId