-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Object Storage] update: fix config bucket lifecycle cannot create
- Loading branch information
hoanglm
committed
Nov 14, 2024
1 parent
0305e99
commit a997f3a
Showing
7 changed files
with
337 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
examples/resources/fptcloud_object_storage/resource_bucket_policy.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
resource "fptcloud_object_storage_bucket_policy" "example_bucket_policy" { | ||
vpc_id = "your_vpc_id" | ||
region_name = "your_region_name" | ||
bucket_name = "your_bucket_name" | ||
|
||
// Option 1: Load policy from file | ||
policy_file = file("${path.module}/your_bucket_policy_json_content.json") | ||
|
||
// Option 2: Inline policy | ||
// policy = jsonencode({ | ||
// Version = "2012-10-17" | ||
// Statement = [ | ||
// { | ||
// Sid = "PublicReadGetObject" | ||
// Effect = "Allow" | ||
// Principal = "*" | ||
// Action = "s3:GetObject" | ||
// Resource = "arn:aws:s3:::example-bucket/*" | ||
// } | ||
// ] | ||
// }) | ||
} | ||
// NOTE: In case wanna delete bucket policy, just ignore policy_file and policy fields | ||
output "bucket_policy" { | ||
value = fptcloud_object_storage_bucket_policy.example_bucket_policy.status | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.