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??

질문됨 8달 전76회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠