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

r/aws_ssm_parameter: Fix arn attribute for full path names and improve testing #2604

Closed
wants to merge 1 commit into from

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Dec 9, 2017

The AWS API allows zero path parameter names without the leading / (e.g. myName), but requires the leading / when placing a parameter under a path (e.g. /path/to/myName). When setting the name with a leading / it would put // in the ARN attribute (e.g. parameter//path/to/myName)

Previously, the testing only checked existence of arn attribute. This augments it to do regex matching for the full value for both the no leading / and with leading / scenarios. It also simplifies the testing configurations and adds the test names to the parameter names in the testing.

make testacc TEST=./aws TESTARGS='-run=TestAccAWSSSMParameter'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSSSMParameter -timeout 120m
=== RUN   TestAccAWSSSMParameter_importBasic
--- PASS: TestAccAWSSSMParameter_importBasic (11.81s)
=== RUN   TestAccAWSSSMParameter_basic
--- PASS: TestAccAWSSSMParameter_basic (9.18s)
=== RUN   TestAccAWSSSMParameter_disappears
--- PASS: TestAccAWSSSMParameter_disappears (8.29s)
=== RUN   TestAccAWSSSMParameter_update
--- PASS: TestAccAWSSSMParameter_update (15.91s)
=== RUN   TestAccAWSSSMParameter_changeNameForcesNew
--- PASS: TestAccAWSSSMParameter_changeNameForcesNew (17.95s)
=== RUN   TestAccAWSSSMParameter_fullPath
--- PASS: TestAccAWSSSMParameter_fullPath (9.65s)
=== RUN   TestAccAWSSSMParameter_secure
--- PASS: TestAccAWSSSMParameter_secure (11.27s)
=== RUN   TestAccAWSSSMParameter_secure_with_key
--- PASS: TestAccAWSSSMParameter_secure_with_key (38.33s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	122.423s

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Dec 12, 2017
@jen20
Copy link
Contributor

jen20 commented Dec 17, 2017

Thanks @bflad! I've rebased this and will merge now. Test run post-rebase:

❯ make testacc TEST=./aws TESTARGS='-run=TestAccAWSSSMParameter'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSSSMParameter -timeout 120m
=== RUN   TestAccAWSSSMParameter_importBasic
--- PASS: TestAccAWSSSMParameter_importBasic (14.23s)
=== RUN   TestAccAWSSSMParameter_basic
--- PASS: TestAccAWSSSMParameter_basic (10.67s)
=== RUN   TestAccAWSSSMParameter_disappears
--- PASS: TestAccAWSSSMParameter_disappears (8.87s)
=== RUN   TestAccAWSSSMParameter_update
--- PASS: TestAccAWSSSMParameter_update (17.70s)
=== RUN   TestAccAWSSSMParameter_changeNameForcesNew
--- PASS: TestAccAWSSSMParameter_changeNameForcesNew (20.12s)
=== RUN   TestAccAWSSSMParameter_fullPath
--- PASS: TestAccAWSSSMParameter_fullPath (11.43s)
=== RUN   TestAccAWSSSMParameter_secure
--- PASS: TestAccAWSSSMParameter_secure (10.24s)
=== RUN   TestAccAWSSSMParameter_secure_with_key
--- PASS: TestAccAWSSSMParameter_secure_with_key (37.56s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	130.860s

@jen20
Copy link
Contributor

jen20 commented Dec 17, 2017

This landed in 6cd9169 - thanks!

@jen20 jen20 closed this Dec 17, 2017
@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants