AWS::CloudFormation::ResourceVersion - AWS CloudFormation

AWS::CloudFormation::ResourceVersion

Registers a resource version with the CloudFormation service. Registering a resource version makes it available for use in CloudFormation templates in your AWS account, and includes:

  • Validating the resource schema.

  • Determining which handlers, if any, have been specified for the resource.

  • Making the resource available for use in your account.

For more information on how to develop resources and ready them for registration, see Creating Resource Providers in the CloudFormation CLI User Guide.

You can have a maximum of 50 resource versions registered at a time. This maximum is per account and per Region.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::CloudFormation::ResourceVersion", "Properties" : { "ExecutionRoleArn" : String, "LoggingConfig" : LoggingConfig, "SchemaHandlerPackage" : String, "TypeName" : String } }

YAML

Type: AWS::CloudFormation::ResourceVersion Properties: ExecutionRoleArn: String LoggingConfig: LoggingConfig SchemaHandlerPackage: String TypeName: String

Properties

ExecutionRoleArn

The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume when invoking the resource. If your resource calls AWS APIs in any of its handlers, you must create an IAM execution role that includes the necessary permissions to call those AWS APIs, and provision that execution role in your account. When CloudFormation needs to invoke the resource type handler, CloudFormation assumes this execution role to create a temporary session token, which it then passes to the resource type handler, thereby supplying your resource type with the appropriate credentials.

Required: No

Type: String

Pattern: arn:.+:iam::[0-9]{12}:role/.+

Minimum: 1

Maximum: 256

Update requires: Replacement

LoggingConfig

Logging configuration information for a resource.

Required: No

Type: LoggingConfig

Update requires: Replacement

SchemaHandlerPackage

A URL to the S3 bucket containing the resource project package that contains the necessary files for the resource you want to register.

For information on generating a schema handler package for the resource you want to register, see submit in the CloudFormation CLI User Guide.

Note

The user registering the resource must be able to access the package in the S3 bucket. That is, the user needs to have GetObject permissions for the schema handler package. For more information, see Actions, Resources, and Condition Keys for Amazon S3 in the AWS Identity and Access Management User Guide.

Required: Yes

Type: String

Minimum: 1

Maximum: 4096

Update requires: Replacement

TypeName

The name of the resource being registered.

We recommend that resource names adhere to the following pattern: company_or_organization::service::type.

Note

The following organization namespaces are reserved and can't be used in your resource names:

  • Alexa

  • AMZN

  • Amazon

  • AWS

  • Custom

  • Dev

Required: Yes

Type: String

Pattern: ^[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}::[A-Za-z0-9]{2,64}$

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ARN of the resource version. For example:

arn:aws:cloudformation:us-west-2:012345678901:type/resource/Sample-CloudFormation-Resource/00000001

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

Arn

The Amazon Resource Name (ARN) of the extension.

IsDefaultVersion

Whether the specified extension version is set as the default version.

This applies only to private extensions you have registered in your account, and extensions published by AWS. For public third-party extensions, whether they are activated in your account, CloudFormation returns null.

ProvisioningType

For resource type extensions, the provisioning behavior of the resource type. CloudFormation determines the provisioning type during registration, based on the types of handlers in the schema handler package submitted.

Valid values include:

  • FULLY_MUTABLE: The resource type includes an update handler to process updates to the type during stack update operations.

  • IMMUTABLE: The resource type doesn't include an update handler, so the type can't be updated and must instead be replaced during stack update operations.

  • NON_PROVISIONABLE: The resource type doesn't include all the following handlers, and therefore can't actually be provisioned.

    • create

    • read

    • delete

TypeArn

The Amazon Resource Name (ARN) of the extension.

VersionId

The ID of a specific version of the extension. The version ID is the value at the end of the Amazon Resource Name (ARN) assigned to the extension version when it is registered.

If you specify a VersionId, DescribeType returns information about that specific extension version. Otherwise, it returns information about the default extension version.

Visibility

The scope at which the extension is visible and usable in CloudFormation operations.

Valid values include:

  • PRIVATE: The extension is only visible and usable within the account in which it is registered. CloudFormation marks any extensions you register as PRIVATE.

  • PUBLIC: The extension is publicly visible and usable within any AWS account.

Examples

Specifying a resource version

The following example demonstrates how to specify a new resource version.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "ResourceVersion": { "Type": "AWS::CloudFormation::ResourceVersion", "Properties": { "TypeName": "My::Sample::Resource", "SchemaHandlerPackage": "s3://my-sample-resourceversion-bucket/my-sample-resource.zip" } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: ResourceVersion: Type: AWS::CloudFormation::ResourceVersion Properties: TypeName: My::Sample::Resource SchemaHandlerPackage: s3://my-sample-resourceversion-bucket/my-sample-resource.zip

Specifying a resource version and setting it as the default version

The following example demonstrates how to specify and new resource version, and use the Ref return value to set that version as the default version.

JSON

{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "ResourceVersion": { "Type": "AWS::CloudFormation::ResourceVersion", "Properties": { "TypeName": "My::Sample::Resource", "SchemaHandlerPackage": "s3://my-sample-resourceversion-bucket/my-sample-resource.zip" } }, "ResourceDefaultVersion": { "Type": "AWS::CloudFormation::ResourceDefaultVersion", "Properties": { "TypeVersionArn": { "Ref": "ResourceVersion" } } } } }

YAML

AWSTemplateFormatVersion: 2010-09-09 Resources: ResourceVersion: Type: AWS::CloudFormation::ResourceVersion Properties: TypeName: My::Sample::Resource SchemaHandlerPackage: s3://my-sample-resourceversion-bucket/my-sample-resource.zip ResourceDefaultVersion: Type: AWS::CloudFormation::ResourceDefaultVersion Properties: TypeVersionArn: !Ref ResourceVersion