pulumi-aws-native icon indicating copy to clipboard operation
pulumi-aws-native copied to clipboard

AWS Chatbot SlackChannelConfiguration update fails

Open Tirke opened this issue 2 years ago • 1 comments

👋

I've deployed some SlackChannelConfiguration.

new chatbot.SlackChannelConfiguration(`slack-bot-${env}`, {
    configurationName: `${env}-slack-bot-config`,
    iamRoleArn: iamRole.arn,
    slackChannelId,
    slackWorkspaceId,
    snsTopicArns: [pushTopic.arn],
    loggingLevel: 'ERROR',
  })

Later I made some change on the IAM policy that resulted in the role replacement and while trying to update the SlackChannelConfiguration, pulumi failed with that error operation error CloudControl: UpdateResource, https response error StatusCode: 400, RequestID: be889c61-f25e-40b4-9aea-acda68952071, api error ValidationException: Model validation failed (#/GuardrailPolicies/0: failed validation constraint for keyword [pattern]).

I then saw here: https://github.com/pulumi/pulumi-aws-native/blob/a06f8f064492741ce1f5f91c7d901836f62a24ed/sdk/nodejs/chatbot/slackChannelConfiguration.ts#L46-L48

That there is some magic around guardrailPolicies if you don't explicitly define them. I went ahead and added guardrailPolicies: ['arn:aws:iam::aws:policy/AdministratorAccess'] to my conf, and it fixed the issue.

From the user perspective this is not great because error message is complicated and the behaviour is weird. Is it possible to improve this?

Tirke avatar Nov 26 '21 10:11 Tirke