Skip to content

Root resource was present, but now absent error #98

@askaribragimov

Description

@askaribragimov

I make use of the module to create an AWS Lambda. I am changing the block as shown below:

//WAS

  attach_policy = true
  policy        = aws_iam_policy.allow_ssm_read.arn
  
//NOW

attach_policies = true
  policies = [
    aws_iam_policy.allow_ssm_read.arn,
    "arn:aws:iam::aws:policy/CloudWatchLambdaInsightsExecutionRolePolicy"
  ]
  number_of_policies = 2

I am getting a behaviour, that when I run terraform first time, I get:

Error: Provider produced inconsistent result after apply

When applying changes to
module.<my-module>.module.lambda.aws_iam_role_policy_attachment.additional_many[0],
provider "registry.terraform.io/hashicorp/aws" produced an unexpected new
value: Root resource was present, but now absent.

However a second run added the SSM-related policy (that USED to be there initially) and no error is produced.

Is it something that can be improved so I do not get an error for the first run?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions