Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Can't use create SSM Association with SSM Document Parameters #90

Open
@stuhay

Description

I seem to be unable to use SSM Document Parameters in an SSM Association

Trying to get vaporshell to output the parameter on an SSM association as follows, which is known to work within Cloudformation

  ssmAssoc1:
    Type: AWS::SSM::Association
    Properties:
      InstanceId: !Ref "Ec2InstanceLinCen101"
      Parameters:
        Hostname:
          - sss

Running the raw command:
New-VSSSMAssociation -InstanceId 'i-xxxxxxxxxxxxxx' -LogicalId ssmAssoc1 -Name stuart -Parameters @{ Hostname = @('sss') } -verbose

which results in this ERROR:
New-VSSSMAssociation: This parameter only accepts the following types: Vaporshell.Resource.SSM.Association.ParameterValues. The current types of the value are: System.Collections.Hashtable, System.Object.

So I try ParameterValues as per https://vaporshell.io/docs/glossary/Add-VSSSMAssociationParameterValues

New-VSSSMAssociation -InstanceId 'i-xxxxxxxxxxxxxx' -LogicalId ssmAssoc1 -Name stuart -Parameters ( Add-VSSSMAssociationParameterValues -ParameterValues @{ Hostname = @('sss') } ) -verbose
And it adds an extra level called ParamterValues

VERBOSE: Resulting JSON from New-VaporResource:

{
  "ssmAssoc1": {
    "Type": "AWS::SSM::Association",
    "Properties": {
      "InstanceId": "i-xxxxxxxxxxxxxx",
      "Name": "stuart",
      "Parameters": {
        "ParameterValues": {
          "Hostname": [
            "sss"
          ]
        }
      }
    }
  }
}

Which if I run in the resulting template, it fails to create because "ParameterValues" is not a parameter

Resource handler returned message: "Invalid request provided: Parameter "ParameterValues" is not defined in the document.

Have tried different variations ParameterValues doesn't give the result that will allow the template to work.

Is there a bug here, or am I just doing something wrong ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions