Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAM resource was not able to destroy after created #7421

Open
dave-asl opened this issue Jul 4, 2024 · 0 comments
Open

RAM resource was not able to destroy after created #7421

dave-asl opened this issue Jul 4, 2024 · 0 comments

Comments

@dave-asl
Copy link

dave-asl commented Jul 4, 2024

Terraform Version

Terraform v1.8.5
on linux_amd64
+ provider registry.terraform.io/aliyun/alicloud v1.226.0
+ provider registry.terraform.io/hashicorp/alicloud v1.226.0

Affected Resource(s)

  • alicloud_ram_policy_document
  • alicloud_ram_policy

Terraform Configuration Files

terraform {
  required_providers {
    alicloud = {
      source = "aliyun/alicloud"
      version = "1.226.0"
    }
  }
}

data "alicloud_ram_policy_document" "CloudflowPolicy" {
  version = "1"
  statement {
    effect    = "Allow"
    action    = [ "fnf:StartExecution", "fc:InvokeFunction" ]
    resource  = [ "*" ] 
  }
}

resource "alicloud_ram_policy" "CloudflowExecRole" {
  policy_name     = var.Cloudflow_RAM_name
  policy_document = data.alicloud_ram_policy_document.CloudflowPolicy.document
  description     = "cloud flow execution role"
}

Debug Output

https://gist.github.com/dave-asl/d5c81b15c3abece2087e46c49e59a374

Panic Output

│ Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_ram_role.go:208:
│ [ERROR] terraform-provider-alicloud/alicloud/service_alicloud_ram.go:90:
│ json: cannot unmarshal array into Go struct field RolePolicyStatement.Statement.Action of type string
│ 
│ 

Expected Behavior

Terraform will remove the resource 'alicloud_ram_policy' without error

Actual Behavior

It passed the terraform validate, then failed on terraform plan mentioned in panic output

Steps to Reproduce

  1. run terraform init
  2. run terraform validate
  3. run terraform plan
  4. run terraform apply
  5. Comment the resource of 'alicloud_ram_policy' and data 'alicloud_ram_policy_document'
  6. run terraform plan

Important Factoids

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant