Skip to content

AWS::SSM::Parameter resource #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aws-ssm-parameter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ target/

# our logs
rpdk.log

sam-tests
4 changes: 3 additions & 1 deletion aws-ssm-parameter/.rpdk-config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"artifact_type": "RESOURCE",
"typeName": "AWS::SSM::Parameter",
"language": "java",
"runtime": "java8",
Expand All @@ -12,5 +13,6 @@
"parameter"
],
"protocolVersion": "2.0.0"
}
},
"executableEntrypoint": "com.amazonaws.ssm.parameter.HandlerWrapperExecutable"
}
84 changes: 26 additions & 58 deletions aws-ssm-parameter/aws-ssm-parameter.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,105 +5,73 @@
"properties": {
"Type": {
"type": "string",
"description": "The type of the parameter.",
"enum": [
"String",
"StringList",
"SecureString"
]
},
"Value": {
"type": "string",
"description": "The value associated with the parameter.",
"minLength": 1,
"maxLength": 32768
"description": "The type of parameter."
},
"Description": {
"type": "string",
"description": "The information about the parameter.",
"minLength": 0,
"maxLength": 1024
"description": "Information about the parameter."
},
"Policies": {
"type": "string",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an object - it can take both a JSON and a String? Can you test this to verify? (Stringification is usually applicable to policies, but please verify it)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CFN Doc says Policies is of type String

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried creating it via CLI with Json value instead of String, and faced below error.

Parameter validation failed:
Invalid type for parameter Policies

"description": "The policies attached to the parameter."
"description": "Information about the policies assigned to a parameter."
},
"AllowedPattern": {
"type": "string",
"description": "The regular expression used to validate the parameter value.",
"minLength": 0,
"maxLength": 1024
"description": "A regular expression used to validate the parameter value."
},
"Tier": {
"type": "string",
"description": "The corresponding tier of the parameter.",
"enum": [
"Standard",
"Advanced",
"Intelligent-Tiering"
]
"description": "The parameter tier."
},
"Tags": {
"type": "object",
"description": "A key-value pair to associate with a resource.",
"patternProperties": {
"^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$": {
"type": "string"
}
},
"additionalProperties": false
"Value": {
"type": "string",
"description": "The parameter value."
},
"DataType": {
"type": "string",
"description": "The corresponding DataType of the parameter.",
"enum": [
"text",
"aws:ec2:image"
]
"description": "The data type of the parameter, such as text or aws:ec2:image. The default is text."
},
"Tags": {
"type": "object",
"description": "Optional metadata that you assign to a resource in the form of an arbitrary set of tags (key-value pairs)"
},
"Name": {
"type": "string",
"description": "The name of the parameter.",
"minLength": 1,
"maxLength": 2048
"description": "The name of the parameter."
}
},
"taggable": false,
"required": [
"Value",
"Type"
"Type",
"Value"
],
"createOnlyProperties": [
"/properties/Name"
],
"primaryIdentifier": [
"/properties/Name"
],
"readOnlyProperties": [
"/properties/Name",
"/properties/Type",
"/properties/Value"
],
"handlers": {
"create": {
"permissions": [
"ssm:PutParameter",
"ssm:GetParameters"
],
"timeoutInMinutes": 5
"ssm:GetParameters",
"ssm:PutParameter"
]
},
"read": {
"permissions": [
"ssm:GetParameters"
"ssm:GetParameters",
"ssm:DescribeParameters",
"ssm:ListTagsForResource"
]
},
"update": {
"permissions": [
"ssm:PutParameter",
"ssm:GetParameters",
"ssm:AddTagsToResource",
"ssm:RemoveTagsFromResource",
"ssm:GetParameters"
],
"timeoutInMinutes": 5
"ssm:RemoveTagsFromResource"
]
},
"delete": {
"permissions": [
Expand Down
140 changes: 140 additions & 0 deletions aws-ssm-parameter/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# AWS::SSM::Parameter

Resource Type definition for AWS::SSM::Parameter

## Syntax

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

### JSON

<pre>
{
"Type" : "AWS::SSM::Parameter",
"Properties" : {
"<a href="#type" title="Type">Type</a>" : <i>String</i>,
"<a href="#description" title="Description">Description</a>" : <i>String</i>,
"<a href="#policies" title="Policies">Policies</a>" : <i>String</i>,
"<a href="#allowedpattern" title="AllowedPattern">AllowedPattern</a>" : <i>String</i>,
"<a href="#tier" title="Tier">Tier</a>" : <i>String</i>,
"<a href="#value" title="Value">Value</a>" : <i>String</i>,
"<a href="#datatype" title="DataType">DataType</a>" : <i>String</i>,
"<a href="#tags" title="Tags">Tags</a>" : <i>Map</i>,
"<a href="#name" title="Name">Name</a>" : <i>String</i>
}
}
</pre>

### YAML

<pre>
Type: AWS::SSM::Parameter
Properties:
<a href="#type" title="Type">Type</a>: <i>String</i>
<a href="#description" title="Description">Description</a>: <i>String</i>
<a href="#policies" title="Policies">Policies</a>: <i>String</i>
<a href="#allowedpattern" title="AllowedPattern">AllowedPattern</a>: <i>String</i>
<a href="#tier" title="Tier">Tier</a>: <i>String</i>
<a href="#value" title="Value">Value</a>: <i>String</i>
<a href="#datatype" title="DataType">DataType</a>: <i>String</i>
<a href="#tags" title="Tags">Tags</a>: <i>Map</i>
<a href="#name" title="Name">Name</a>: <i>String</i>
</pre>

## Properties

#### Type

The type of parameter.

_Required_: Yes

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Description

Information about the parameter.

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Policies

Information about the policies assigned to a parameter.

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### AllowedPattern

A regular expression used to validate the parameter value.

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Tier

The parameter tier.

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Value

The parameter value.

_Required_: Yes

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### DataType

The data type of the parameter, such as text or aws:ec2:image. The default is text.

_Required_: No

_Type_: String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Tags

Optional metadata that you assign to a resource in the form of an arbitrary set of tags (key-value pairs)

_Required_: No

_Type_: Map

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### Name

The name of the parameter.

_Required_: No

_Type_: String

_Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return Values

### Ref

When you pass the logical ID of this resource to the intrinsic `Ref` function, Ref returns the Name.
Loading