Class ArnComponents
Inheritance
Implements
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ArnComponents : Object, IArnComponents
Syntax (vb)
Public Class ArnComponents
Inherits Object
Implements IArnComponents
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AwsApigatewayv2Authorizers;
using Amazon.CDK.AwsApigatewayv2Integrations;
// This function handles your connect route
Function connectHandler;
var webSocketApi = new WebSocketApi(this, "WebSocketApi");
webSocketApi.AddRoute("$connect", new WebSocketRouteOptions {
Integration = new WebSocketLambdaIntegration("Integration", connectHandler),
Authorizer = new WebSocketIamAuthorizer()
});
// Create an IAM user (identity)
var user = new User(this, "User");
var webSocketArn = Stack.Of(this).FormatArn(new ArnComponents {
Service = "execute-api",
Resource = webSocketApi.ApiId
});
// Grant access to the IAM user
user.AttachInlinePolicy(new Policy(this, "AllowInvoke", new PolicyProps {
Statements = new [] {
new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "execute-api:Invoke" },
Effect = Effect.ALLOW,
Resources = new [] { webSocketArn }
}) }
}));
Synopsis
Constructors
ArnComponents() |
Properties
Account | The ID of the AWS account that owns the resource, without the hyphens. |
ArnFormat | The specific ARN format to use for this ARN value. |
Partition | The partition that the resource is in. |
Region | The region the resource resides in. |
Resource | Resource type (e.g. "table", "autoScalingGroup", "certificate"). For some resource types, e.g. S3 buckets, this field defines the bucket name. |
ResourceName | Resource name or path within the resource (i.e. S3 bucket object key) or a wildcard such as |
Service | The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline'). |
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
System.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 Nullable<ArnFormat> ArnFormat { get; set; }
Property Value
System.Nullable<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
System.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
System.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
System.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
System.String
Service
The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline').
public string Service { get; set; }
Property Value
System.String