Class PhysicalResourceId
Physical ID of the custom resource.
Namespace: Amazon.CDK.CustomResources
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PhysicalResourceId : DeputyBase
Syntax (vb)
Public Class PhysicalResourceId Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var crossAccountRoleArn = "arn:aws:iam::OTHERACCOUNT:role/CrossAccountRoleName"; // arn of role deployed in separate account
var callRegion = "us-west-1"; // sdk call to be made in specified region (optional)
// sdk call to be made in specified region (optional)
new AwsCustomResource(this, "CrossAccount", new AwsCustomResourceProps {
OnCreate = new AwsSdkCall {
AssumedRoleArn = crossAccountRoleArn,
Region = callRegion, // optional
Service = "sts",
Action = "GetCallerIdentity",
PhysicalResourceId = PhysicalResourceId.Of("id")
},
Policy = AwsCustomResourcePolicy.FromStatements(new [] { PolicyStatement.FromJson(new Dictionary<string, string> {
{ "Effect", "Allow" },
{ "Action", "sts:AssumeRole" },
{ "Resource", crossAccountRoleArn }
}) })
});
Synopsis
Properties
| Id | Literal string to be used as the physical id. |
| ResponsePath | Path to a response data element to be used as the physical id. |
Methods
| FromResponse(string) | Extract the physical resource id from the path (dot notation) to the data in the API call response. |
| Of(string) | Explicit physical resource id. |
Properties
Id
Literal string to be used as the physical id.
public virtual string? Id { get; }
Property Value
Remarks
ExampleMetadata: infused
ResponsePath
Path to a response data element to be used as the physical id.
public virtual string? ResponsePath { get; }
Property Value
Remarks
ExampleMetadata: infused
Methods
FromResponse(string)
Extract the physical resource id from the path (dot notation) to the data in the API call response.
public static PhysicalResourceId FromResponse(string responsePath)
Parameters
- responsePath string
Returns
Remarks
ExampleMetadata: infused
Of(string)
Explicit physical resource id.
public static PhysicalResourceId Of(string id)
Parameters
- id string
Returns
Remarks
ExampleMetadata: infused