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 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南