AWS::IoT::SoftwarePackageVersion
Use the AWS::IoT::SoftwarePackageVersion
resource to create a software
package version.
For information about working with software package versions, see AWS IoT Device Management Software Package Catalog and Creating a software package and package version in the AWS IoT Developer Guide. See also, CreatePackageVersion in the API Guide.
Note
The associated software package must exist before the package version is created. If you create a software package and package version in the same CloudFormation template, set the software package as a dependency of the package version. If they are created out of sequence, you will receive an error.
Package versions and created in a draft
state, for more information, see
Package version lifecycle. To change the package version state after it’s
created, use the UpdatePackageVersionAPI command.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::IoT::SoftwarePackageVersion", "Properties" : { "Attributes" :
{
, "Description" :Key
:Value
, ...}String
, "PackageName" :String
, "Tags" :[ Tag, ... ]
, "VersionName" :String
} }
YAML
Type: AWS::IoT::SoftwarePackageVersion Properties: Attributes:
Description:
Key
:Value
String
PackageName:String
Tags:- Tag
VersionName:String
Properties
Attributes
-
Metadata that can be used to define a package version’s configuration. For example, the S3 file location, configuration options that are being sent to the device or fleet.
The combined size of all the attributes on a package version is limited to 3KB.
Required: No
Type: Object of String
Pattern:
^[a-zA-Z0-9:_-]+$
Minimum:
1
Update requires: No interruption
Description
-
A summary of the package version being created. This can be used to outline the package's contents or purpose.
Required: No
Type: String
Pattern:
^[^\p{C}]+$
Minimum:
0
Maximum:
1024
Update requires: No interruption
PackageName
-
The name of the associated software package.
Required: Yes
Type: String
Pattern:
^[a-zA-Z0-9-_.]+$
Minimum:
1
Maximum:
128
Update requires: Replacement
-
Metadata that can be used to manage the package version.
Required: No
Type: Array of Tag
Maximum:
50
Update requires: No interruption
VersionName
-
The name of the new package version.
Required: No
Type: String
Pattern:
^[a-zA-Z0-9-_.]+$
Minimum:
1
Maximum:
64
Update requires: Replacement
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the software package name and package version. For
example:
{ "Ref": "MyPackageVersion" }
Response:
package-name|version-name
For a stack named MyStack, a value that is similar to the following is returned:
MyStack-MyPackageVersion-AB1CDEFGHIJK
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
.
For example:
{ "GetAtt": "MySoftwarePackageVersion.PackageVersionArn" }
ErrorReason
-
Error reason for a package version failure during creation or update.
PackageVersionArn
-
The Amazon Resource Name (ARN) for the package.
Status
-
The status of the package version. For more information, see Package version lifecycle.
Examples
The following example declares a package version and the values of its attributes.
JSON
{ "AWSTemplateFormatVersion":"2010-09-09", "Resources":{ "MyPackageVersion":{ "Type": "AWS::IoT::SoftwarePackageVersion", "Properties": { "PackageName": "PackageName", "VersionName": "1.0.0", "Description": "description", "Tags": [ { "Key": "TagKey", "Value": "TagValue" } ] } } }
YAML
AWSTemplateFormatVersion: '2010-09-09' Resources: MyPackageVersion: Type: AWS::IoT::SoftwarePackageVersion Properties: PackageName: "PackageName" VersionName: "1.0.0" Description: "description" Tags: - Key: "TagKey" Value: "TagValue"