Skip to content

Commit f8ccb99

Browse files
committedOct 16, 2023
Add example for creating Self provisioned AWS S3 or S3 compatible storage credential for data protection
Signed-off-by: Ramya Bangera <bangerar@vmware.com>
1 parent 3b8edbd commit f8ccb99

File tree

5 files changed

+79
-14
lines changed

5 files changed

+79
-14
lines changed
 

‎docs/data-sources/kubernetes_secret.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ Only one scope per resource is allowed.
3030
```terraform
3131
# Read Tanzu Mission Control kubernetes secret : fetch namespace details
3232
data "tanzu-mission-control_kubernetes_secret" "read_secret" {
33-
name = "tf-secret" # Required
34-
namespace_name = "tf-secret-namespace-name" # Required
33+
name = "tf-secret" # Required
34+
namespace_name = "tf-secret-namespace-name" # Required
3535
3636
scope {
3737
cluster {
38-
cluster_name = "testcluster" # Required
39-
provisioner_name = "attached" # Default: attached
40-
management_cluster_name = "attached" # Default: attached
38+
cluster_name = "testcluster" # Required
39+
provisioner_name = "attached" # Default: attached
40+
management_cluster_name = "attached" # Default: attached
4141
}
4242
}
4343
}

‎docs/resources/credential.md

+33
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,39 @@ resource "tanzu-mission-control_credential" "tmc_provisioned_aws_s3_cred" {
172172
}
173173
```
174174

175+
# Credential for Self provisioned AWS S3 or S3-compatible storage used for data-protection
176+
177+
## Example Usage
178+
179+
```terraform
180+
# Create Self provisioned AWS S3 or S3-compatible credential
181+
resource "tanzu-mission-control_credential" "aws_eks_cred" {
182+
name = "tf-aws-s3-self-test"
183+
184+
meta {
185+
description = "Self provisioned AWS S3 or S3-compatible storage credential for data protection"
186+
labels = {
187+
"key1" : "value1",
188+
}
189+
}
190+
191+
spec {
192+
capability = "DATA_PROTECTION"
193+
provider = "GENERIC_S3"
194+
data {
195+
key_value {
196+
type = "OPAQUE_SECRET_TYPE"
197+
data = {
198+
"aws_access_key_id" = "abcd="
199+
"aws_secret_access_key" = "xyz=="
200+
}
201+
}
202+
}
203+
}
204+
ready_wait_timeout = "1m" // Wait time for credential create operations to finish (default: 3m).
205+
}
206+
```
207+
175208
# Credential for Tanzu Observability
176209

177210
## Example Usage

‎docs/resources/kubernetes_secret.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ Only one scope per resource is allowed.
3636
```terraform
3737
# Create Tanzu Mission Control kubernetes secret with attached set as default value.
3838
resource "tanzu-mission-control_kubernetes_secret" "create_secret" {
39-
name = "tf-secret" # Required
40-
namespace_name = "tf-secret-namespace-name" # Required
39+
name = "tf-secret" # Required
40+
namespace_name = "tf-secret-namespace-name" # Required
4141
4242
scope {
4343
cluster {
44-
cluster_name = "testcluster" # Required
45-
provisioner_name = "attached" # Default: attached
46-
management_cluster_name = "attached" # Default: attached
44+
cluster_name = "testcluster" # Required
45+
provisioner_name = "attached" # Default: attached
46+
management_cluster_name = "attached" # Default: attached
4747
}
4848
}
4949
50-
export = false # Default: false
50+
export = false # Default: false
5151
5252
meta {
5353
description = "Create namespace through terraform"
@@ -56,9 +56,9 @@ resource "tanzu-mission-control_kubernetes_secret" "create_secret" {
5656
5757
spec {
5858
docker_config_json {
59-
username = "testusername" # Required
60-
password = "testpassword" # Required
61-
image_registry_url = "testimageregistryurl" # Required
59+
username = "testusername" # Required
60+
password = "testpassword" # Required
61+
image_registry_url = "testimageregistryurl" # Required
6262
}
6363
}
6464
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Create Self provisioned AWS S3 or S3-compatible credential
2+
resource "tanzu-mission-control_credential" "aws_eks_cred" {
3+
name = "tf-aws-s3-self-test"
4+
5+
meta {
6+
description = "Self provisioned AWS S3 or S3-compatible storage credential for data protection"
7+
labels = {
8+
"key1" : "value1",
9+
}
10+
}
11+
12+
spec {
13+
capability = "DATA_PROTECTION"
14+
provider = "GENERIC_S3"
15+
data {
16+
key_value {
17+
type = "OPAQUE_SECRET_TYPE"
18+
data = {
19+
"aws_access_key_id" = "abcd="
20+
"aws_secret_access_key" = "xyz=="
21+
}
22+
}
23+
}
24+
}
25+
ready_wait_timeout = "1m" // Wait time for credential create operations to finish (default: 3m).
26+
}

‎templates/resources/credential.md.tmpl

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ For proxy credential add the annotation `proxyType : explicit` for explicit prox
3131

3232
{{ tffile "examples/resources/credential/dataprotection.tf" }}
3333

34+
# Credential for Self provisioned AWS S3 or S3-compatible storage used for data-protection
35+
36+
## Example Usage
37+
38+
{{ tffile "examples/resources/credential/generic_s3.tf" }}
39+
3440
# Credential for Tanzu Observability
3541

3642
## Example Usage

0 commit comments

Comments
 (0)
Please sign in to comment.