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ビュー
回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ