You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a bucket policy as described here and here with a principal does not work because it cannot be parsed into a string array.
See below for an example Terraform code and the error output.
Expected behavior
Environment
Terraform version:
1.5.7
Provider version:
6.5.0
OS:
not relevant
Configuration Files
resource "ionoscloud_s3_bucket" "example" {
name = "example"
region = "eu-central-3"
}
resource "ionoscloud_s3_bucket_policy" "example" {
bucket = ionoscloud_s3_bucket.example.name
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Sid = "Delegate certain actions to another user",
Effect = "Allow",
Principal = {
AWS = [
"arn:aws:iam:::user/CONTRACT_USER_ID1"
]
}
Action = ["s3:*"]
Resource = [
"arn:aws:s3:::${ionoscloud_s3_bucket.example.name}",
"arn:aws:s3:::${ionoscloud_s3_bucket.example.name}/*"
]
}
]
})
}
Error and Debug Output
╷
│ Error: Normalized JSON Unmarshal Error
│
│ with ionoscloud_s3_bucket_policy.example,
│ on bucket.tf line 14, in resource "ionoscloud_s3_bucket_policy" "example":
│ 14: resource "ionoscloud_s3_bucket_policy" "example" {
│
│ json: cannot unmarshal object into Go struct field
│ bucketPolicyStatement.Statement.Principal of type []string
╵
The text was updated successfully, but these errors were encountered:
Description
Creating a bucket policy as described here and here with a principal does not work because it cannot be parsed into a string array.
See below for an example Terraform code and the error output.
Expected behavior
Environment
Terraform version:
Provider version:
OS:
Configuration Files
Error and Debug Output
The text was updated successfully, but these errors were encountered: