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:
- Created 4 years ago
- Comments:10 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eladb this is a duplicte of https://github.com/aws/aws-cdk/issues/3092
As a workaround, you should be able to use an escape hatch (
association.addPropertyOverride
) to render the correct output (without theParameterValues
key). LMK if you need help to get this to work.