Skip to content

Commit

Permalink
Merge pull request #580 from duplocloud/release/0.10.31
Browse files Browse the repository at this point in the history
Release v0.10.31
  • Loading branch information
tahir-duplo authored Jul 9, 2024
2 parents 010e00e + 55f6265 commit 8ba270c
Show file tree
Hide file tree
Showing 38 changed files with 1,418 additions and 255 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NAMESPACE=duplocloud

NAME=duplocloud
BINARY=terraform-provider-${NAME}
VERSION=0.10.30
VERSION=0.10.31
#mac
#OS_ARCH=darwin_amd64
#OS_ARCH=linux_amd64
Expand Down
1 change: 1 addition & 0 deletions docs/resources/aws_apigateway_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ resource "duplocloud_aws_apigateway_event" "apigateway_event" {

### Optional

- `api_key_required` (Boolean) Specify if the method requires an API key.
- `authorization_type` (String) Type of authorization used for the method. (`NONE`, `CUSTOM`, `AWS_IAM`, `COGNITO_USER_POOLS`)
- `authorizer_id` (String) Authorizer id to be used when the authorization is `CUSTOM` or `COGNITO_USER_POOLS`.
- `cors` (Boolean) Enable handling of preflight requests.
Expand Down
129 changes: 108 additions & 21 deletions docs/resources/aws_dynamodb_table_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,110 @@ resource "duplocloud_aws_dynamodb_table_v2" "tst-dynamodb-table" {
}
#ttl example: currently ttl can be set during creating resource
resource "duplocloud_aws_dynamodb_table_v2" "tst-dynamodb-table" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "tst-dynamodb-table"
read_capacity = 11
write_capacity = 12
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "mytable"
read_capacity = 80
write_capacity = 40
billing_mode = "PROVISIONED"
is_point_in_time_recovery = false
deletion_protection_enabled = false
tag {
key = "CreatedBy"
value = "Duplo"
key = "school"
value = "admission"
}
attribute {
name = "ForumName"
type = "S"
}
attribute {
name = "Subject"
type = "S"
}
attribute {
name = "LastPostDateTime"
type = "S"
}
attribute {
name = "PostMonth"
type = "S"
}
attribute {
name = "GamerZone"
type = "S"
}
attribute {
name = "TopScore"
type = "N"
}
key_schema {
attribute_name = "ForumName"
key_type = "HASH"
}
key_schema {
attribute_name = "Subject"
key_type = "RANGE"
}
global_secondary_index {
name = "PostDate"
hash_key = "PostMonth"
range_key = "LastPostDateTime"
write_capacity = 2
read_capacity = 2
projection_type = "KEYS_ONLY"
}
global_secondary_index {
name = "GamerZone"
hash_key = "GamerZone"
range_key = "TopScore"
write_capacity = 5
read_capacity = 5
projection_type = "ALL"
}
server_side_encryption {
enabled = false
}
local_secondary_index { #local secondary index doesnot support updation
hash_key = "ForumName"
name = "LastPostIndex"
range_key = "LastPostDateTime"
projection_type = "KEYS_ONLY"
}
}
resource "duplocloud_aws_dynamodb_table_v2" "tst-dynamodb-table" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "mytable"
read_capacity = 80
write_capacity = 40
billing_mode = "PROVISIONED"
is_point_in_time_recovery = false
deletion_protection_enabled = false
tag {
key = "CreatedFrom"
value = "Duplo"
key = "school"
value = "admission"
}
attribute {
name = "UserId"
name = "ForumName"
type = "S"
}
attribute {
name = "Subject"
type = "S"
}
attribute {
name = "LastPostDateTime"
type = "S"
}
attribute {
name = "PostMonth"
type = "S"
}
Expand Down Expand Up @@ -135,17 +221,17 @@ resource "duplocloud_aws_dynamodb_table_v2" "tst-dynamodb-table" {

### Required

- `attribute` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--attribute))
- `key_schema` (Block List, Min: 1) (see [below for nested schema](#nestedblock--key_schema))
- `name` (String) The name of the table, this needs to be unique within a region.
- `tenant_id` (String) The GUID of the tenant that the dynamodb table will be created in.

### Optional

- `attribute` (Block Set) (see [below for nested schema](#nestedblock--attribute))
- `billing_mode` (String) Controls how you are charged for read and write throughput and how you manage capacity. The valid values are `PROVISIONED` and `PAY_PER_REQUEST`. Defaults to `PROVISIONED`.
- `deletion_protection_enabled` (Boolean) Deletion protection keeps the tables from being deleted unintentionally. While this setting is on, you can't delete the table.
- `global_secondary_index` (Block Set) Describe a GSI for the table; subject to the normal limits on the number of GSIs, projected attributes, etc. (see [below for nested schema](#nestedblock--global_secondary_index))
- `is_point_in_time_recovery` (Boolean) The point in time recovery status of the dynamodb table. Enabled if true.
- `key_schema` (Block List) (see [below for nested schema](#nestedblock--key_schema))
- `local_secondary_index` (Block Set) (see [below for nested schema](#nestedblock--local_secondary_index))
- `read_capacity` (Number) The number of read units for this table. If the `billing_mode` is `PROVISIONED`, this field is required.
- `server_side_encryption` (Block List, Max: 1) Encryption at rest options. AWS DynamoDB tables are automatically encrypted at rest with an AWS owned Customer Master Key if this argument isn't specified. (see [below for nested schema](#nestedblock--server_side_encryption))
Expand Down Expand Up @@ -175,6 +261,15 @@ Required:
- `type` (String) Attribute type, which must be a scalar type: `S`, `N`, or `B` for (S)tring, (N)umber or (B)inary data


<a id="nestedblock--key_schema"></a>
### Nested Schema for `key_schema`

Required:

- `attribute_name` (String) The name of the attribute
- `key_type` (String) Applicable key types are `HASH` or `RANGE`.


<a id="nestedblock--global_secondary_index"></a>
### Nested Schema for `global_secondary_index`

Expand All @@ -192,20 +287,12 @@ Optional:
- `write_capacity` (Number) The number of write units for this index. Must be set if `billing_mode` is set to `PROVISIONED`.


<a id="nestedblock--key_schema"></a>
### Nested Schema for `key_schema`

Required:

- `attribute_name` (String) The name of the attribute
- `key_type` (String) Applicable key types are `HASH` or `RANGE`.


<a id="nestedblock--local_secondary_index"></a>
### Nested Schema for `local_secondary_index`

Required:

- `hash_key` (String) The name of the hash key in the index; must be defined as an attribute in the resource.
- `name` (String) The name of the index.
- `projection_type` (String) One of `ALL`, `INCLUDE` or `KEYS_ONLY` where `ALL` projects every attribute into the index, `KEYS_ONLY` projects just the hash and range key into the index, and `INCLUDE` projects only the keys specified in the `non_key_attributes` parameter.
- `range_key` (String) The name of the range key; must be defined.
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/aws_elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "duplocloud_aws_elasticsearch" "es-doc" {
- `encrypt_at_rest` (Block List, Max: 1) The storage encryption settings for the ElasticSearch instance. (see [below for nested schema](#nestedblock--encrypt_at_rest))
- `require_ssl` (Boolean) Whether or not to require SSL for accessing this ElasticSearch instance.
- `selected_zone` (Number) The numerical index of the zone to launch this ElasticSearch instance in.
- `storage_size` (Number) The storage volume size, in GB, for the ElasticSearch instance. Defaults to `20`.
- `storage_size` (Number) The storage volume size, in GB, for the ElasticSearch instance.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
- `use_latest_tls_cipher` (Boolean) Whether or not to use the latest TLS cipher for this ElasticSearch instance.
- `vpc_options` (Block List) (see [below for nested schema](#nestedblock--vpc_options))
Expand Down
10 changes: 7 additions & 3 deletions docs/resources/aws_sns_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ resource "duplocloud_tenant" "myapp" {
plan_id = "default"
}
# Without KMS Key
# Without KMS Key running as fifo
resource "duplocloud_aws_sns_topic" "sns_topic" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "duplo_topic"
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "duplo_topic.fifo" # AWS requires the ".fifo" extension for fifo sns topics
fifo_topic = true
fifo_content_based_deduplication = true
}
# With Tenant KMS Key
Expand All @@ -46,6 +48,8 @@ resource "duplocloud_aws_sns_topic" "sns_topic" {

### Optional

- `fifo_content_based_deduplication` (Boolean) Whether to enable content based deduplication for fifo type SNS topics Defaults to `false`.
- `fifo_topic` (Boolean) Whether the topic processes messages as fifo or not Defaults to `false`.
- `kms_key_id` (String) The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

Expand Down
142 changes: 142 additions & 0 deletions docs/resources/gcp_s3_bucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "duplocloud_gcp_s3_bucket Resource - terraform-provider-duplocloud"
subcategory: ""
description: |-
---

# duplocloud_gcp_s3_bucket (Resource)



## Example Usage

```terraform
resource "duplocloud_tenant" "myapp" {
account_name = "myapp"
plan_id = "default"
}
# Simple Example 1: Deploy an S3 bucket with hardened security settings.
resource "duplocloud_gcp_s3_bucket" "mydata" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "mydata"
allow_public_access = false
enable_access_logs = true
enable_versioning = true
managed_policies = ["ssl"]
default_encryption {
method = "Sse" # For even stricter security, use "TenantKms" here.
}
}
# Simple Example 2: Deploy a hardened S3 bucket suitable for public website hosting.
resource "duplocloud_gcp_s3_bucket" "www" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "website"
allow_public_access = true
enable_access_logs = true
enable_versioning = true
managed_policies = ["ssl"]
default_encryption {
method = "Sse"
}
}
# Simple Example 3: Deploy an S3 bucket to dersired region.
resource "duplocloud_s3_bucket" "mydata" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "mydata"
# optional, if not provided, tenant region will be used
region = "us-west-2"
}
# Simple Example 4: Deploy an S3 bucket with multiple region.
resource "duplocloud_gcp_s3_bucket" "mydata" {
tenant_id = duplocloud_tenant.myapp.tenant_id
name = "mydata"
allow_public_access = true
enable_access_logs = true
enable_versioning = true
managed_policies = ["ssl"]
default_encryption {
method = "Sse" # For even stricter security, use "TenantKms" here.
}
location = "Asia" #pass region value (Asia/EU/US)to location to enable multi region
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) The short name of the S3 bucket. Duplo will add a prefix to the name. You can retrieve the full name from the `fullname` attribute.
- `tenant_id` (String) The GUID of the tenant that the S3 bucket will be created in.

### Optional

- `allow_public_access` (Boolean) Whether or not to remove the public access block from the bucket.
- `default_encryption` (Block List, Max: 1) Default encryption settings for objects uploaded to the bucket. (see [below for nested schema](#nestedblock--default_encryption))
- `enable_access_logs` (Boolean) Whether or not to enable access logs. When enabled, Duplo will send access logs to a centralized S3 bucket per plan.
- `enable_versioning` (Boolean) Whether or not to enable versioning.
- `location` (String) The location is to set multi region, applicable for gcp cloud.
- `managed_policies` (List of String) Duplo can manage your S3 bucket policy for you, based on simple list of policy keywords:

- `"ssl"`: Require SSL / HTTPS when accessing the bucket.
- `"ignore"`: If this key is present, Duplo will not manage your bucket policy.
- `region` (String) The region of the S3 bucket.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `arn` (String) The ARN of the S3 bucket.
- `domain_name` (String) The domain name of the S3 bucket.
- `fullname` (String) The full name of the S3 bucket.
- `id` (String) The ID of this resource.
- `tags` (List of Object) (see [below for nested schema](#nestedatt--tags))

<a id="nestedblock--default_encryption"></a>
### Nested Schema for `default_encryption`

Optional:

- `method` (String) Default encryption method. Must be one of: `None`, `Sse`, `AwsKms`, `TenantKms`. Defaults to `Sse`.


<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)


<a id="nestedatt--tags"></a>
### Nested Schema for `tags`

Read-Only:

- `key` (String)
- `value` (String)

## Import

Import is supported using the following syntax:

```shell
# Example: Importing an existing S3 bucket
# - *TENANT_ID* is the tenant GUID
# - *SHORTNAME* is the short name of the S3 bucket (without the duploservices prefix)
#
terraform import duplocloud_gcp_s3_bucket.mybucket *TENANT_ID*/*SHORTNAME*
```
1 change: 0 additions & 1 deletion duplocloud/data_source_duplo_k8_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func dataSourceK8SecretRead(ctx context.Context, d *schema.ResourceData, m inter
break
}
}
usrResp.IsReadOnly = true
}
rp, err := c.K8SecretGet(tenantID, name)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions duplocloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ func Provider() *schema.Provider {
"duplocloud_plan_waf": resourcePlanWaf(),
"duplocloud_plan_kms": resourcePlanKMS(),
"duplocloud_aws_apigateway_event": resourceAwsApiGatewayEvent(),
"duplocloud_gcp_s3_bucket": resourceGCPS3Bucket(),
},
DataSourcesMap: map[string]*schema.Resource{
"duplocloud_admin_aws_credentials": dataSourceAdminAwsCredentials(),
Expand Down
Loading

0 comments on commit 8ba270c

Please sign in to comment.