SSM association invalid parameter and no target

0

I have created a document, Iam and Association using terraform. The purpose of my code is to auto execute a script that describes ec2 instances.

After I run my code the document and association are successfully created but My association is failing in the aws console with the error invalid parameter and it also shows no target in the console. If I manually make an association using the document I created with my code it is totally fine

I do have a ssm_automation role and a policy to allow EC2 to all resources. This is my association code:

resource "aws_ssm_association" "testabc" { name = aws_ssm_document.test.name schedule_expression = "cron(0 11 0 ? * * *)" automation_target_parameter_name = "targets"

parameters = { AutomationAssumeRole = aws_iam_role.ssm_automation_roletest.arn } targets { key = "aws:NoOpAutomationTag" values = ["AWS-NoOpAutomationTarget-Value"] } }

in my document I do have a parameters: AutomationAssumeRole: type: String description: default: "${aws_iam_role.ssm_automation_role.arn}"

How do I fix this problem. Should my document have an another pararmeter for an instance id?? Should I have an additional policy on the Iam role for SSM for EC2??

preguntada hace 8 meses76 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas