question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to create ssm association

See original GitHub issue

🐛 Bug Report

What is the problem?

I’m unable to use ssm.CfnAssociation to create an association in systems manager. There seems to be something wrong with the parameters field.

Reproduction Steps

This does not work:

    const association = new ssm.CfnAssociation(this, "Association", {
      targets: [
        {
          key: "InstanceIds",
          values: [instance.instanceId]
        }
      ],
      parameters: {
        dnsIpAddresses: {
          parameterValues: props.microsoftAd.attrDnsIpAddresses
        },
        directoryName: {
          parameterValues: [props.microsoftAdHostName]
        },
        directoryId: {
          parameterValues: [props.microsoftAd.ref]
        }
      },
      name: document.ref
    });

This works fine:

    const association = new cdk.CfnResource(this, "Association", {
      type: "AWS::SSM::Association",
      properties: {
        Targets: [
          {
            Key: "InstanceIds",
            Values: [instance.instanceId]
          }
        ],
        Parameters: {
          dnsIpAddresses: props.microsoftAd.attrDnsIpAddresses,
          directoryName: [props.microsoftAdHostName],
          directoryId: [props.microsoftAd.ref]
        },
        Name: document.ref
      }
    });

Verbose Log

 6/15 | 07:35:46 | CREATE_FAILED        | AWS::SSM::Association                 | WindowsBastion/Association (WindowsBastionAssociationC8296AE5) Value of {Parameters} must be a map where each value is a list of {String}
        new WindowsBastion (/Users/ash/Projects/VFZiggo/bicc/infrastructure/bicc/lib/central-vpc-mock-stack/windows-bastion.ts:121:25)
        \_ new CentralVpcMockStack (/Users/ash/Projects/VFZiggo/bicc/infrastructure/bicc/lib/central-vpc-mock-stack/index.ts:91:28)
        \_ Object.<anonymous> (/Users/ash/Projects/VFZiggo/bicc/infrastructure/bicc/bin/bicc.ts:29:29)
        \_ Module._compile (module.js:652:30)
        \_ Module.m._compile (/Users/ash/Projects/VFZiggo/bicc/infrastructure/bicc/node_modules/ts-node/src/index.ts:473:23)
        \_ Module._extensions..js (module.js:663:10)
        \_ Object.require.extensions.(anonymous function) [as .ts] (/Users/ash/Projects/VFZiggo/bicc/infrastructure/bicc/node_modules/ts-node/src/index.ts:476:12)
        \_ Module.load (module.js:565:32)
        \_ tryModuleLoad (module.js:505:12)
        \_ Function.Module._load (module.js:497:3)
        \_ Function.Module.runMain (module.js:693:10)
        \_ Object.<anonymous> (/Users/ash/Projects/VFZiggo/bicc/infrastructure/bicc/node_modules/ts-node/src/bin.ts:158:12)
        \_ Module._compile (module.js:652:30)
        \_ Object.Module._extensions..js (module.js:663:10)
        \_ Module.load (module.js:565:32)
        \_ tryModuleLoad (module.js:505:12)
        \_ Function.Module._load (module.js:497:3)
        \_ Function.Module.runMain (module.js:693:10)
        \_ findNodeScript.then.existing (/Users/ash/.nvm/versions/node/v8.10.0/lib/node_modules/npm/node_modules/libnpx/index.js:268:14)
        \_ <anonymous>

Environment

  • CDK CLI Version: 1.8.0
  • Module Version: 1.8.0
  • OS: macOS Sierra
  • Language: TypeScript

Other information

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
kuhnboycommented, Jan 10, 2020
2reactions
eladbcommented, Sep 23, 2019

As a workaround, you should be able to use an escape hatch (association.addPropertyOverride) to render the correct output (without the ParameterValues key). LMK if you need help to get this to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot a State Manager association that failed or that is ...
If the State Manager association remains stuck in pending or failed state, first confirm that the latest version of SSM Agent is installed....
Read more >
Creating associations - Amazon Systems Manager
Create a State Manager association by using the Systems Manager console, the Amazon CLI, or Tools for Windows PowerShell.
Read more >
I cannot update a State Manager Association Created By Cfn?
**EDIT: I'm finding this to be more broadly behavior with SSM Associations. I can create them with Cfn, but any attempt to update...
Read more >
create-association-batch - ssm - Amazon AWS
create-association-batch --entries <value> [--cli-input-json ... Systems Manager documents (SSM documents) that use schema version 2.0 or later will fail.
Read more >
Terraform to call an SSM document - Stack Overflow
When I run this, I get the error: Error creating SSM association: ValidationException: The assume role is invalid.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found