Skip to content
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

Add example for Self provisioned AWS S3 or S3-compatible storage credential creation #296

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions docs/data-sources/kubernetes_secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ Only one scope per resource is allowed.
```terraform
# Read Tanzu Mission Control kubernetes secret : fetch namespace details
data "tanzu-mission-control_kubernetes_secret" "read_secret" {
name = "tf-secret" # Required
namespace_name = "tf-secret-namespace-name" # Required
name = "tf-secret" # Required
namespace_name = "tf-secret-namespace-name" # Required
shobha2626 marked this conversation as resolved.
Show resolved Hide resolved

scope {
cluster {
cluster_name = "testcluster" # Required
provisioner_name = "attached" # Default: attached
management_cluster_name = "attached" # Default: attached
cluster_name = "testcluster" # Required
provisioner_name = "attached" # Default: attached
management_cluster_name = "attached" # Default: attached
}
}
}
Expand Down
33 changes: 33 additions & 0 deletions docs/resources/credential.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,39 @@ resource "tanzu-mission-control_credential" "tmc_provisioned_aws_s3_cred" {
}
```

# Credential for Self provisioned AWS S3 or S3-compatible storage used for data-protection

## Example Usage

```terraform
# Create Self provisioned AWS S3 or S3-compatible credential
resource "tanzu-mission-control_credential" "aws_eks_cred" {
name = "tf-aws-s3-self-test"

meta {
description = "Self provisioned AWS S3 or S3-compatible storage credential for data protection"
labels = {
"key1" : "value1",
}
}

spec {
capability = "DATA_PROTECTION"
provider = "GENERIC_S3"
data {
key_value {
type = "OPAQUE_SECRET_TYPE"
data = {
"aws_access_key_id" = "abcd="
"aws_secret_access_key" = "xyz=="
}
}
}
}
ready_wait_timeout = "1m" // Wait time for credential create operations to finish (default: 3m).
shobha2626 marked this conversation as resolved.
Show resolved Hide resolved
}
```

# Credential for Tanzu Observability

## Example Usage
Expand Down
18 changes: 9 additions & 9 deletions docs/resources/kubernetes_secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ Only one scope per resource is allowed.
```terraform
# Create Tanzu Mission Control kubernetes secret with attached set as default value.
resource "tanzu-mission-control_kubernetes_secret" "create_secret" {
name = "tf-secret" # Required
namespace_name = "tf-secret-namespace-name" # Required
name = "tf-secret" # Required
namespace_name = "tf-secret-namespace-name" # Required

scope {
cluster {
cluster_name = "testcluster" # Required
provisioner_name = "attached" # Default: attached
management_cluster_name = "attached" # Default: attached
cluster_name = "testcluster" # Required
provisioner_name = "attached" # Default: attached
management_cluster_name = "attached" # Default: attached
}
}

export = false # Default: false
export = false # Default: false

meta {
description = "Create namespace through terraform"
Expand All @@ -56,9 +56,9 @@ resource "tanzu-mission-control_kubernetes_secret" "create_secret" {

spec {
docker_config_json {
username = "testusername" # Required
password = "testpassword" # Required
image_registry_url = "testimageregistryurl" # Required
username = "testusername" # Required
password = "testpassword" # Required
image_registry_url = "testimageregistryurl" # Required
}
}
}
Expand Down
26 changes: 26 additions & 0 deletions examples/resources/credential/generic_s3.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Create Self provisioned AWS S3 or S3-compatible credential
resource "tanzu-mission-control_credential" "aws_eks_cred" {
name = "tf-aws-s3-self-test"

meta {
description = "Self provisioned AWS S3 or S3-compatible storage credential for data protection"
labels = {
"key1" : "value1",
}
}

spec {
capability = "DATA_PROTECTION"
provider = "GENERIC_S3"
data {
key_value {
type = "OPAQUE_SECRET_TYPE"
data = {
"aws_access_key_id" = "abcd="
"aws_secret_access_key" = "xyz=="
}
}
}
}
ready_wait_timeout = "1m" // Wait time for credential create operations to finish (default: 3m).
}
6 changes: 6 additions & 0 deletions templates/resources/credential.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ For proxy credential add the annotation `proxyType : explicit` for explicit prox

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

# Credential for Self provisioned AWS S3 or S3-compatible storage used for data-protection

## Example Usage

{{ tffile "examples/resources/credential/generic_s3.tf" }}

# Credential for Tanzu Observability

## Example Usage
Expand Down