Hi All,
Need your kind help around below issue, I am getting while using null_resource. I have created two buckets and just want to simply run a command for both the buckets with the help of null resource. However I am getting error " This object has no argument, nested block, or exported attribute named arn ". Could anyone please guide me what I am doing wrong here. Actually I am bit new in Terraform.
Code:
provider "aws" {
region = "eu-west-1"
}
provider "null" {}
variable "bucketname" {
type = "list"
default = ["mytestbuckettfmodule1", "mytestbuckettfmodule2"]
}
below resource to create two buckets, working fine
resource "aws_s3_bucket" "mybucket" {
for_each = toset(var.bucketname)
bucket = each.value
acl = "private"
tags = {
Company = "ABC"
CostCenter = "21102353"
Environment = "NonProd"
Name = "TestInstane"
Role = "Test"
Service = "Test"
User = "[kapil.teotia@ABC.com](mailto:kapil.teotia@ABC.com)"
}
}
below null resource I am using to execute command under local-exec for both the buckets but unfortunately getting error
########################################