Class ArnFormat
An enum representing the various ARN formats that different services use.
Inheritance
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class ArnFormat : Enum
Syntax (vb)
Public NotInheritable Class ArnFormat
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
Stack stack;
// Builds "arn:<PARTITION>:lambda:<REGION>:<ACCOUNT>:function:MyFunction"
stack.FormatArn(new ArnComponents {
Service = "lambda",
Resource = "function",
ArnFormat = ArnFormat.COLON_RESOURCE_NAME,
ResourceName = "MyFunction"
});
Synopsis
Fields
COLON_RESOURCE_NAME | This represents a format where the 'resource' and 'resourceName' parts are separated with a colon. |
NO_RESOURCE_NAME | This represents a format where there is no 'resourceName' part. |
SLASH_RESOURCE_NAME | This represents a format where the 'resource' and 'resourceName' parts are separated with a slash. |
SLASH_RESOURCE_SLASH_RESOURCE_NAME | This represents a format where the 'resource' and 'resourceName' parts are seperated with a slash, but there is also an additional slash after the colon separating 'account' from 'resource'. |
value__ |
Fields
COLON_RESOURCE_NAME
This represents a format where the 'resource' and 'resourceName' parts are separated with a colon.
public const ArnFormat COLON_RESOURCE_NAME
Field Value
Type | Description |
---|---|
ArnFormat |
Remarks
Like in: 'arn:aws:service:region:account:resource:resourceName'. Everything after the last colon is considered the 'resourceName', even if it contains slashes, like in 'arn:aws:apigateway:region:account:resource:/test/mydemoresource/*'.
NO_RESOURCE_NAME
This represents a format where there is no 'resourceName' part.
public const ArnFormat NO_RESOURCE_NAME
Field Value
Type | Description |
---|---|
ArnFormat |
Remarks
This format is used for S3 resources, like 'arn:aws:s3:::bucket'. Everything after the last colon is considered the 'resource', even if it contains slashes, like in 'arn:aws:s3:::bucket/object.zip'.
SLASH_RESOURCE_NAME
This represents a format where the 'resource' and 'resourceName' parts are separated with a slash.
public const ArnFormat SLASH_RESOURCE_NAME
Field Value
Type | Description |
---|---|
ArnFormat |
Remarks
Like in: 'arn:aws:service:region:account:resource/resourceName'. Everything after the separating slash is considered the 'resourceName', even if it contains colons, like in 'arn:aws:cognito-sync:region:account:identitypool/us-east-1:1a1a1a1a-ffff-1111-9999-12345678:bla'.
SLASH_RESOURCE_SLASH_RESOURCE_NAME
This represents a format where the 'resource' and 'resourceName' parts are seperated with a slash, but there is also an additional slash after the colon separating 'account' from 'resource'.
public const ArnFormat SLASH_RESOURCE_SLASH_RESOURCE_NAME
Field Value
Type | Description |
---|---|
ArnFormat |
Remarks
Like in: 'arn:aws:service:region:account:/resource/resourceName'. Note that the leading slash is not included in the parsed 'resource' part.
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |