Table of Contents

Class ArnComponents

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll
public class ArnComponents : IArnComponents
Inheritance
ArnComponents
Implements
Inherited Members

Examples

var subZone = new PublicHostedZone(this, "SubZone", new PublicHostedZoneProps {
                ZoneName = "sub.someexample.com"
            });

            // import the delegation role by constructing the roleArn
            var delegationRoleArn = Stack.Of(this).FormatArn(new ArnComponents {
                Region = "",  // IAM is global in each partition
                Service = "iam",
                Account = "parent-account-id",
                Resource = "role",
                ResourceName = "MyDelegationRole"
            });
            var delegationRole = Role.FromRoleArn(this, "DelegationRole", delegationRoleArn);

            // create the record
            // create the record
            new CrossAccountZoneDelegationRecord(this, "delegate", new CrossAccountZoneDelegationRecordProps {
                DelegatedZone = subZone,
                ParentHostedZoneName = "someexample.com",  // or you can use parentHostedZoneId
                DelegationRole = delegationRole
            });

Remarks

ExampleMetadata: infused

Constructors

ArnComponents()

public ArnComponents()

Properties

Account

The ID of the AWS account that owns the resource, without the hyphens.

public string? Account { get; set; }

Property Value

string

Remarks

For example, 123456789012. Note that the ARNs for some resources don't require an account number, so this component might be omitted.

Default: The account the stack is deployed to.

ArnFormat

The specific ARN format to use for this ARN value.

public ArnFormat? ArnFormat { get; set; }

Property Value

ArnFormat?

Remarks

Default: - uses value of sep as the separator for formatting, ArnFormat.SLASH_RESOURCE_NAME if that property was also not provided

Partition

The partition that the resource is in.

public string? Partition { get; set; }

Property Value

string

Remarks

For standard AWS regions, the partition is aws. If you have resources in other partitions, the partition is aws-partitionname. For example, the partition for resources in the China (Beijing) region is aws-cn.

Default: The AWS partition the stack is deployed to.

Region

The region the resource resides in.

public string? Region { get; set; }

Property Value

string

Remarks

Note that the ARNs for some resources do not require a region, so this component might be omitted.

Default: The region the stack is deployed to.

Resource

Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name.

public string Resource { get; set; }

Property Value

string

ResourceName

Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as "*". This is service-dependent.

public string? ResourceName { get; set; }

Property Value

string

Sep

(deprecated) Separator between resource type and the resource.

[Obsolete("use arnFormat instead")]
public string? Sep { get; set; }

Property Value

string

Remarks

Can be either '/', ':' or an empty string. Will only be used if resourceName is defined.

Default: '/'

Stability: Deprecated

Service

The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipline').

public string Service { get; set; }

Property Value

string