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

aws_ssm_parameter resource does not have a overwrite option #1004

Closed
FransUrbo opened this issue Jun 29, 2017 · 12 comments · Fixed by #1006
Closed

aws_ssm_parameter resource does not have a overwrite option #1004

FransUrbo opened this issue Jun 29, 2017 · 12 comments · Fixed by #1006
Labels
bug Addresses a defect in current functionality.

Comments

@FransUrbo
Copy link

I'm trying to update/replace a Parameter Store value, but TF gives ParameterAlreadyExists.

Terraform Version

0.9.8

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_ssm_parameter
@FransUrbo
Copy link
Author

I notice after I've deleted the param, run terraform apply and then ran terraform apply again some time later, that it can't detect that the parameter already exists!

So a better option (because I'm encrypting the parameter with a KMS key and I'm not sure TF can get the param, decrypt it with the key - how would it know WHICH key?? - and then check if it differs from what is in the state or the value option) might be to simply try see if the param already exists, and then ignore it (as in, not to create one).

@stack72 stack72 added the bug Addresses a defect in current functionality. label Jun 29, 2017
stack72 added a commit that referenced this issue Jun 29, 2017
Fixes: #1004

```
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_basic
--- PASS: TestAccAWSSSMParameter_basic (68.88s)
=== RUN   TestAccAWSSSMParameter_update
--- PASS: TestAccAWSSSMParameter_update (90.39s)
=== RUN   TestAccAWSSSMParameter_secure
--- PASS: TestAccAWSSSMParameter_secure (50.50s)
=== RUN   TestAccAWSSSMParameter_secure_with_key
--- PASS: TestAccAWSSSMParameter_secure_with_key (125.95s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	335.743s
```
@FransUrbo
Copy link
Author

FransUrbo commented Jun 29, 2017

Another issue:

If the name value is changed (not sure if it's related to the param also been deleted), I get:

[ERROR] SSM Parameter XXX is invalid

Not sure if this is related to the original issue. If not, I'll open a new issue about that.

To get around that (since the param is deleted from the AWS Console), I simply removed it from the state and rerun apply.

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2017

@FransUrbo if possible, can you try and recreate that issue and then open an alternative about that?

@FransUrbo
Copy link
Author

Ok, no worries!

Regarding the "can't detect already exists" above. This MIGHT be because I had the same resource name (but different name value) in several modules.

As in:

resource "aws_ssm_parameter" "hiera-private" {
    [...]
}

in all my modules. Prefixing the resource name, seems to have solved the "recreation issue"...

@FransUrbo
Copy link
Author

PS. Please back port to 0.9 if possible!

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2017

Hi @FransUrbo

there will be no further releases of the 0.9 services I'm afraid

Paul

@FransUrbo
Copy link
Author

Ok, bummer :(. So 0.10 is starting to be ok? Last I saw it was just a beta release... ?

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2017

@FransUrbo it was the first release in the major version series - it will take a few betas before we GA it

stack72 added a commit that referenced this issue Jun 29, 2017
…1006)

Fixes: #1004

```
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_basic
--- PASS: TestAccAWSSSMParameter_basic (68.88s)
=== RUN   TestAccAWSSSMParameter_update
--- PASS: TestAccAWSSSMParameter_update (90.39s)
=== RUN   TestAccAWSSSMParameter_secure
--- PASS: TestAccAWSSSMParameter_secure (50.50s)
=== RUN   TestAccAWSSSMParameter_secure_with_key
--- PASS: TestAccAWSSSMParameter_secure_with_key (125.95s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	335.743s
```
@FransUrbo
Copy link
Author

If that's so, I'd very much like you to continue supporting 0.9. I'm not ready (i.e., brave/stupid enough), to hand my whole production environment to beta code!

@stack72
Copy link
Contributor

stack72 commented Jun 29, 2017 via email

@FransUrbo
Copy link
Author

That's kind'a what I meant by "support 0.9". I did NOT mean to add features etc into it so we're in full agreement there. However, we might have a slight disagreement on the word critical :).

This one does not comply to that IMO, just to make things clear :D.

@ghost
Copy link

ghost commented Apr 11, 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 11, 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 a pull request may close this issue.

2 participants