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

Terraform Apply Fails on SSM_Document creation when SSM Doc type is set to Automation #12746

Closed
tyjonesAncestry opened this issue Mar 15, 2017 · 6 comments

Comments

@tyjonesAncestry
Copy link

tyjonesAncestry commented Mar 15, 2017

Hi there,

Terraform Version

Terraform v0.9.0

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_ssm_document

Terraform Configuration Files

data "aws_caller_identity" "current" {}

data "aws_region" "current" {
  current = true
}

resource "aws_ssm_document" "autotest" {
  name          = "REDACTED"
  document_type = "Automation"

  content = <<DOC
REDACTED
DOC
}

Debug Output

https://gist.github.com/tyjonesAncestry/e40f599cd16415e5a3e90e3ec3e383fd

Panic Output

https://gist.github.com/tyjonesAncestry/c2e7cffcd39ca6dfa2435f2a74a74a80

Expected Behavior

My SSM Automation Document should have been created with Terraform.

Actual Behavior

Terraform loses it's mind with an EOF error, but the resource somehow still gets created in my AWS console. However, it breaks all subsequent runs of terraform.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Create an SSM Document of type "Automation"
  2. Run terraform plan
  3. Plan looks good.
  4. Run terraform apply.
  5. Terraform crashes.

Important Factoids

SSM Document creation works flawlessly as long as the document_type filed is set to "Command"

References

@tyjonesAncestry
Copy link
Author

Nil Pointer exception is being thrown on line 208 of https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_ssm_document.go

param["description"] = *dp.Description appears to be getting a nil value from the resourceAwsSsmDocumentRead function.

Maybe the AWS API is returning a different value for SSM Command Docs vs SSM Automation Docs?

@stack72 stack72 added the crash label Mar 16, 2017
@tyjonesAncestry
Copy link
Author

We have a fix that we're internally testing right now. Once we've confirmed the fix is in place we'll open up a PR with the code fix.

@stack72
Copy link
Contributor

stack72 commented Mar 18, 2017

@tyjonesAncestry sorry for the issue here - <3 for looking at opening a PR for this

@dcjohnson
Copy link
Contributor

Should be fixed with with this pr. #12891

@stack72
Copy link
Contributor

stack72 commented Mar 20, 2017

Closed via #12891

@stack72 stack72 closed this as completed Mar 20, 2017
@ghost
Copy link

ghost commented Apr 15, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants