Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 52 additions & 2 deletions docs/resources/s3vectors_vector_bucket_policy.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "awscc_s3vectors_vector_bucket_policy Resource - terraform-provider-awscc"
subcategory: ""
description: |-
Expand All @@ -10,7 +9,58 @@ description: |-

Resource Type definition for AWS::S3Vectors::VectorBucketPolicy

## Example Usage

### Create an S3 Vectors bucket policy
Create an S3 Vectors bucket policy with vector-specific permissions

~> This example is generated by Amazon Bedrock and verified to work using Terraform.

```terraform
resource "awscc_s3vectors_vector_bucket" "example" {
vector_bucket_name = "example-vector-bucket"

tags = [
{
key = "Name"
value = "example-vector-bucket"
},
{
key = "Environment"
value = "example"
}
]
}

resource "awscc_s3vectors_vector_bucket_policy" "example" {
vector_bucket_name = awscc_s3vectors_vector_bucket.example.vector_bucket_name

policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Sid = "AllowVectorOperations"
Effect = "Allow"
Principal = {
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
}
Action = [
"s3vectors:GetVector",
"s3vectors:PutVector",
"s3vectors:DeleteVector",
"s3vectors:ListVectors"
]
Resource = [
"${awscc_s3vectors_vector_bucket.example.vector_bucket_arn}",
"${awscc_s3vectors_vector_bucket.example.vector_bucket_arn}/*"
]
}
]
})
}

data "aws_caller_identity" "current" {}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -68,4 +118,4 @@ The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/c

```shell
$ terraform import awscc_s3vectors_vector_bucket_policy.example "vector_bucket_arn"
```
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
resource "awscc_s3vectors_vector_bucket" "example" {
vector_bucket_name = "example-vector-bucket"

tags = [
{
key = "Name"
value = "example-vector-bucket"
},
{
key = "Environment"
value = "example"
}
]
}

resource "awscc_s3vectors_vector_bucket_policy" "example" {
vector_bucket_name = awscc_s3vectors_vector_bucket.example.vector_bucket_name

policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Sid = "AllowVectorOperations"
Effect = "Allow"
Principal = {
AWS = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"
}
Action = [
"s3vectors:GetVector",
"s3vectors:PutVector",
"s3vectors:DeleteVector",
"s3vectors:ListVectors"
]
Resource = [
"${awscc_s3vectors_vector_bucket.example.vector_bucket_arn}",
"${awscc_s3vectors_vector_bucket.example.vector_bucket_arn}/*"
]
}
]
})
}

data "aws_caller_identity" "current" {}
48 changes: 48 additions & 0 deletions templates/resources/s3vectors_vector_bucket_policy.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}"
subcategory: ""
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Name}} ({{.Type}})

{{ .Description | trimspace }}

## Example Usage

### Create an S3 Vectors bucket policy
Create an S3 Vectors bucket policy with vector-specific permissions

~> This example is generated by Amazon Bedrock and verified to work using Terraform.

{{ tffile (printf "examples/resources/%s/s3vectors_vector_bucket_policy.tf" .Name)}}

{{ .SchemaMarkdown | trimspace }}
{{- if or .HasImport .HasImportIDConfig .HasImportIdentityConfig }}

## Import

Import is supported using the following syntax:
{{- end }}
{{- if .HasImportIdentityConfig }}

In Terraform v1.12.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the `identity` attribute, for example:

{{tffile .ImportIdentityConfigFile }}

{{ .IdentitySchemaMarkdown | trimspace }}
{{- end }}
{{- if .HasImportIDConfig }}

In Terraform v1.5.0 and later, the [`import` block](https://developer.hashicorp.com/terraform/language/import) can be used with the `id` attribute, for example:

{{tffile .ImportIDConfigFile }}
{{- end }}
{{- if .HasImport }}

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

{{codefile "shell" .ImportFile }}

{{- end }}
Loading