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

Error creating SSM document: InvalidDocumentSchemaVersion: Document type is required for schema version 2.0 #11788

Closed
DenisBY opened this issue Feb 8, 2017 · 6 comments

Comments

@DenisBY
Copy link

DenisBY commented Feb 8, 2017

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

$  terraform -v
Terraform v0.8.6

Affected Resource(s)

Please list the resources as a list, for example:

  • aws_ssm_document

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.
provider "aws" {
    region = "${var.region}"
}

data "template_file" "document" {
    template = "${file("${path.module}/amiwindowsupdate.json")}"
}

resource "aws_ssm_document" "document" {
  name    = "WindowsUpdate",
  content = "${data.template_file.document.rendered}"
}
{
   "schemaVersion":"2.0",
   "description":"Run a script",
   "parameters":{
      "commands":{
         "type":"StringList",
         "description":"(Required) Specify a shell script or a command to run.",
         "minItems":1,
         "displayType":"textarea"
      }
   },
   "mainSteps":[
      {
         "action":"aws:runShellScript",
         "name":"runShellScript",
         "inputs":{
            "commands":"{{ commands }}"
         }
      },
      {
         "action":"aws:runPowerShellScript",
         "name":"runPowerShellScript",
         "inputs":{
            "commands":"{{ commands }}"
         }
      }
   ]
}

Expected Behavior

What should have happened?

Document created

Actual Behavior

What actually happened?

Error applying plan:

1 error(s) occurred:

* aws_ssm_document.document: [ERROR] Error creating SSM document: InvalidDocumentSchemaVersion: Document type is required for schema version 2.0
        status code: 400, request id: 261ef6f7-ee1b-11e6-b12a-27e73feaa5c3

Steps to Reproduce

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

  1. terraform apply

I think AWS added document-type as mandatory option not so long time ago as even its documentation doesn't have this option:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-ssm-doc.html#create-ssm-console-cli

@liamjbennett
Copy link
Contributor

@DenisBY this one's on me. Will be a PR to fix soon.

@DenisBY
Copy link
Author

DenisBY commented Feb 16, 2017

I guess it's fixed by this PR?
#11671

@stack72
Copy link
Contributor

stack72 commented Mar 1, 2017

Hi @DenisBY

Not sure if you are in a position to create a new terraform binary and test this for us - but i believe this issue is fixed in master by #11671

Thoughts?

Paul

@DenisBY
Copy link
Author

DenisBY commented Mar 1, 2017

Yes, I was able to use SSM with version 0.8.7, so it's fixed.

@stack72
Copy link
Contributor

stack72 commented Mar 1, 2017

Closed via #11671

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

ghost commented Apr 16, 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 16, 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

3 participants