Interface IArnComponents
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IArnComponents
Syntax (vb)
Public Interface 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
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'). |
Properties
Account
The ID of the AWS account that owns the resource, without the hyphens.
virtual string Account { get; }
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.
virtual Nullable<ArnFormat> ArnFormat { get; }
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.
virtual string Partition { get; }
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.
virtual string Region { get; }
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.
string Resource { get; }
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.
virtual string ResourceName { get; }
Property Value
System.String
Service
The service namespace that identifies the AWS product (for example, 's3', 'iam', 'codepipeline').
string Service { get; }
Property Value
System.String