Skip to content

doc(object): document project ID for bucket child resources #2338

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

Merged
merged 3 commits into from
Dec 22, 2023
Merged
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
8 changes: 6 additions & 2 deletions docs/data-sources/object_bucket_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ data "scaleway_object_bucket_policy" "main" {
## Argument Reference

- `bucket` - (Required) The bucket name.
- `region` - (Defaults to [provider](../index.md#region) `region`) The [region](../guides/regions_and_zones.md#zones) in which the Object Storage exists.
- `project_id` - (Defaults to [provider](../index.md#project_id) `project_id`) The ID of the project the bucket is associated with.
- `region` - (Defaults to [provider](../index.md#arguments-reference) `region`) The [region](../guides/regions_and_zones.md#zones) in which the Object Storage exists.
- `project_id` - (Defaults to [provider](../index.md#arguments-reference) `project_id`) The ID of the project the bucket is associated with.

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the `project_id` for every child resource of the bucket,
like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.


## Attributes Reference
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ The Scaleway provider offers three ways of providing these credentials.
The following methods are supported, in this priority order:

1. [Environment variables](#environment-variables)
1. [Static credentials](#static-credentials)
1. [Shared configuration file](#shared-configuration-file)
2. [Static credentials](#static-credentials)
3. [Shared configuration file](#shared-configuration-file)

### Environment variables

Expand All @@ -154,7 +154,7 @@ $ terraform plan

### Static credentials

!> **Warning**: Hard-coding credentials into any Terraform configuration is not recommended, and risks secret leakage should this file ever be committed to a public version control system.
~> **Warning**: Hard-coding credentials into any Terraform configuration is not recommended, and risks secret leakage should this file ever be committed to a public version control system.

Static credentials can be provided by adding `access_key` and `secret_key` attributes in-line in the Scaleway provider block:

Expand Down
12 changes: 12 additions & 0 deletions docs/resources/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ The following arguments are supported:
* `tags` - (Optional) Map of tags
* `project_id` - (Defaults to [provider](../index.md#arguments-reference) `project_id`) The ID of the project the bucket is associated with.

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the `project_id` for every child resource of the bucket,
like objects. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.


## Attributes Reference

In addition to all arguments above, the following attribute is exported:
Expand All @@ -58,3 +63,10 @@ Objects can be imported using the `{region}/{bucketName}/{objectKey}` identifier
```bash
$ terraform import scaleway_object.some_object fr-par/some-bucket/some-file
```

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

```bash
$ terraform import scaleway_object.some_object fr-par/some-bucket/some-file@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
```
17 changes: 14 additions & 3 deletions docs/resources/object_bucket_acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ The following arguments are supported:
* `region` - (Optional) The [region](https://developers.scaleway.com/en/quickstart/#region-definition) in which the bucket should be created.
* `project_id` - (Defaults to [provider](../index.md#arguments-reference) `project_id`) The ID of the project the bucket is associated with.

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the `project_id` for every child resource of the bucket,
like bucket ACLs. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.


## The ACL

Expand Down Expand Up @@ -118,8 +122,15 @@ In addition to all arguments above, the following attributes are exported:

## Import

Buckets can be imported using the `{region}/{bucketName}/{acl}` identifier, e.g.
Bucket ACLs can be imported using the `{region}/{bucketName}/{acl}` identifier, e.g.

```bash
$ terraform import scaleway_object_bucket_acl.some_bucket fr-par/some-bucket/private
```

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

```bash
$ terraform import scaleway_object_bucket_acl.some_bucket fr-par/some-bucket
/private```
$ terraform import scaleway_object_bucket_acl.some_bucket fr-par/some-bucket/private@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
```
13 changes: 12 additions & 1 deletion docs/resources/object_bucket_lock_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ The following arguments are supported:

- `project_id` - (Defaults to [provider](../index.md#arguments-reference) `project_id`) The ID of the project the bucket is associated with.

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the `project_id` for every child resource of the bucket,
like object lock configurations. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:
Expand All @@ -66,8 +70,15 @@ In addition to all arguments above, the following attributes are exported:

## Import

Lock configuration Bucket can be imported using the `{region}/{bucketName}` identifier, e.g.
Bucket lock configurations can be imported using the `{region}/{bucketName}` identifier, e.g.

```bash
$ terraform import scaleway_object_bucket_lock_configuration.some_bucket fr-par/some-bucket
```

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

```bash
$ terraform import scaleway_object_bucket_lock_configuration.some_bucket fr-par/some-bucket@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
```
13 changes: 12 additions & 1 deletion docs/resources/object_bucket_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ The following arguments are supported:
* `policy` - (Required) The policy document. This is a JSON formatted string. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/tutorials/terraform/aws-iam-policy?_ga=2.164714495.1557487853.1659960650-563504983.1635944492).
* `project_id` - (Defaults to [provider](../index.md#arguments-reference) `project_id`) The ID of the project the bucket is associated with.

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the `project_id` for every child resource of the bucket,
like bucket policies. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.

~> **Important:** The [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) data source may be used, so long as it specifies a principal.

## Attributes Reference
Expand All @@ -238,8 +242,15 @@ In addition to all arguments above, the following attribute is exported:

## Import

Buckets can be imported using the `{region}/{bucketName}` identifier, e.g.
Bucket policies can be imported using the `{region}/{bucketName}` identifier, e.g.

```bash
$ terraform import scaleway_object_bucket_policy.some_bucket fr-par/some-bucket
```

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

```bash
$ terraform import scaleway_object_bucket_policy.some_bucket fr-par/some-bucket@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
```
13 changes: 12 additions & 1 deletion docs/resources/object_bucket_website_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ The following arguments are supported:
* `error_document` - (Optional) The name of the error document for the website [detailed below](#error_document).
* `project_id` - (Defaults to [provider](../index.md#arguments-reference) `project_id`) The ID of the project the bucket is associated with.

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the `project_id` for every child resource of the bucket,
like bucket website configurations. Otherwise, Terraform will try to create the child resource with the default project ID and you will get a 403 error.

### index_document

The `index_document` configuration block supports the following arguments:
Expand All @@ -97,8 +101,15 @@ The error_document configuration block supports the following arguments:

## Import

Website configuration Bucket can be imported using the `{region}/{bucketName}` identifier, e.g.
Bucket website configurations can be imported using the `{region}/{bucketName}` identifier, e.g.

```bash
$ terraform import scaleway_object_bucket_website_configuration.some_bucket fr-par/some-bucket
```

~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

```bash
$ terraform import scaleway_object_bucket_website_configuration.some_bucket fr-par/some-bucket@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
```