Skip to content
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

resource/ssm_parameter: Add version as output #9127

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions aws/data_source_aws_ssm_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func dataSourceAwsSsmParameter() *schema.Resource {
Optional: true,
Default: true,
},
"version": {
Type: schema.TypeInt,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -72,6 +76,7 @@ func dataAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error {
d.Set("name", param.Name)
d.Set("type", param.Type)
d.Set("value", param.Value)
d.Set("version", param.Version)

return nil
}
1 change: 1 addition & 0 deletions aws/data_source_aws_ssm_parameter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestAccAWSSsmParameterDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "type", "String"),
resource.TestCheckResourceAttr(resourceName, "value", "TestValue"),
resource.TestCheckResourceAttr(resourceName, "with_decryption", "false"),
resource.TestCheckResourceAttrSet(resourceName, "version"),
),
},
{
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_ssm_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ func resourceAwsSsmParameter() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"version": {
Type: schema.TypeInt,
Computed: true,
},
"tags": tagsSchema(),
},

Expand Down Expand Up @@ -121,6 +125,7 @@ func resourceAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error
d.Set("name", param.Name)
d.Set("type", param.Type)
d.Set("value", param.Value)
d.Set("version", param.Version)

describeParamsInput := &ssm.DescribeParametersInput{
ParameterFilters: []*ssm.ParameterStringFilter{
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_ssm_parameter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestAccAWSSSMParameter_basic(t *testing.T) {
resource.TestCheckResourceAttr("aws_ssm_parameter.foo", "tier", "Standard"),
resource.TestCheckResourceAttr("aws_ssm_parameter.foo", "tags.%", "1"),
resource.TestCheckResourceAttr("aws_ssm_parameter.foo", "tags.Name", "My Parameter"),
resource.TestCheckResourceAttrSet("aws_ssm_parameter.foo", "version"),
),
},
},
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/ssm_parameter.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ In addition to all arguments above, the following attributes are exported:
* `name` - The name of the parameter.
* `type` - The type of the parameter. Valid types are `String`, `StringList` and `SecureString`.
* `value` - The value of the parameter.
* `version` - The version of the parameter.
1 change: 1 addition & 0 deletions website/docs/r/ssm_parameter.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ In addition to all arguments above, the following attributes are exported:
* `description` - (Required) The description of the parameter.
* `type` - (Required) The type of the parameter. Valid types are `String`, `StringList` and `SecureString`.
* `value` - (Required) The value of the parameter.
* `version` - The version of the parameter.

## Import

Expand Down