-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/dataprotection-clustergroup
- Loading branch information
Showing
131 changed files
with
7,274 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
Title: "Inspection Results Data Source" | ||
Description: |- | ||
Get inspection results | ||
--- | ||
|
||
# Inspection Results Data Source | ||
|
||
This data source enables users to get a specific cluster inspection results. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "tanzu-mission-control_inspection_results" "demo" { | ||
management_cluster_name = "MGMT_CLS_NAME" | ||
provisioner_name = "PROVISIONER_NAME" | ||
cluster_name = "CLS_NAME" | ||
name = "INSPECTION_NAME" | ||
} | ||
output "inspection_report" { | ||
value = jsondecode(data.tanzu-mission-control_inspection_results.demo.status.report) | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cluster_name` (String) Cluster name. | ||
- `management_cluster_name` (String) Management cluster name. | ||
- `name` (String) Inspection name. | ||
- `provisioner_name` (String) Cluster provisioner name. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `status` (Map of String) Status of inspection resource | ||
|
||
## Status Field ## | ||
|
||
Status field is a key-value pair of type string-string and it contains the following keys: | ||
* phase - The phase which the inspection is in. | ||
* phase_info - Information about the phase. | ||
* report - JSON encoded string of the report data in the inspection. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
Title: "Inspections Data Source" | ||
Description: |- | ||
List cluster inspections | ||
--- | ||
|
||
# Inspections Data Source | ||
|
||
This data source enables users to list cluster inspections. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "tanzu-mission-control_inspections" "demo" { | ||
management_cluster_name = "MGMT_CLS_NAME" | ||
provisioner_name = "PROVISIONER_NAME" | ||
cluster_name = "CLS_NAME" | ||
} | ||
output "inspections" { | ||
value = data.tanzu-mission-control_inspections.demo.inspections | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cluster_name` (String) Cluster name. | ||
- `management_cluster_name` (String) Management cluster name. | ||
- `provisioner_name` (String) Cluster provisioner name. | ||
|
||
### Optional | ||
|
||
- `name` (String) Inspection name. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `inspections` (List of Object) Inspection objects. (see [below for nested schema](#nestedatt--inspections)) | ||
- `total_count` (String) Total count of inspections returned. | ||
|
||
<a id="nestedatt--inspections"></a> | ||
### Nested Schema for `inspections` | ||
|
||
Read-Only: | ||
|
||
- `cluster_name` (String) | ||
- `management_cluster_name` (String) | ||
- `name` (String) | ||
- `provisioner_name` (String) | ||
- `status` (Map of String) | ||
|
||
## Status Field ## | ||
|
||
Status field is a key-value pair of type string-string and it contains the following keys: | ||
* phase - The phase which the inspection is in. | ||
* phase_info - Information about the phase. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
--- | ||
Title: "Permission Template Data Source" | ||
Description: |- | ||
Retrieves an AWS CloudFormation permission template for creating credentials. | ||
--- | ||
|
||
# Permission Template Data Source | ||
|
||
This data source enables users get an AWS CloudFormation template for creating the necessary assets in AWS when creating TMC credentials. | ||
|
||
**NOTE**: Currently, only the 'AWS_EC2' and 'AWS_EKS' capabilities are supported in conjunction with the 'DATA_PROTECTION' and 'MANAGED_K8S_PROVIDER' providers. | ||
|
||
# Data Protection Permission Template | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
locals { | ||
credentials_name = "test-permission-template-data-protection-tf-111" | ||
tanzu_capability = "DATA_PROTECTION" | ||
tanzu_provider = "AWS_EC2" | ||
stack_message = split("\n", aws_cloudformation_stack.crendetials_permission_template.outputs.Message) | ||
permission_arn = element(local.stack_message, length(local.stack_message) - 1) | ||
} | ||
data "tanzu-mission-control_permission_template" "data_protection_permissions" { | ||
credentials_name = local.credentials_name | ||
tanzu_capability = local.tanzu_capability | ||
tanzu_provider = local.tanzu_provider | ||
} | ||
resource "aws_cloudformation_stack" "crendetials_permission_template" { | ||
name = local.credentials_name | ||
parameters = data.tanzu-mission-control_permission_template.data_protection_permissions.template_values != null ? data.tanzu-mission-control_permission_template.data_protection_permissions.template_values : {} | ||
template_body = base64decode(data.tanzu-mission-control_permission_template.data_protection_permissions.template) | ||
capabilities = ["CAPABILITY_NAMED_IAM"] | ||
} | ||
resource "tanzu-mission-control_credential" "data_protection_cred" { | ||
name = local.credentials_name | ||
spec { | ||
capability = local.tanzu_capability | ||
provider = local.tanzu_provider | ||
data { | ||
aws_credential { | ||
iam_role { | ||
arn = local.permission_arn | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
# EKS Permission Template | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
locals { | ||
credentials_name = "test-permission-template-eks-tf-43" | ||
tanzu_capability = "MANAGED_K8S_PROVIDER" | ||
tanzu_provider = "AWS_EKS" | ||
stack_message = split("\n", aws_cloudformation_stack.crendetials_permission_template.outputs.Message) | ||
permission_arn = element(local.stack_message, length(local.stack_message) - 1) | ||
} | ||
data "tanzu-mission-control_permission_template" "eks_permissions" { | ||
credentials_name = local.credentials_name | ||
tanzu_capability = local.tanzu_capability | ||
tanzu_provider = local.tanzu_provider | ||
} | ||
resource "aws_cloudformation_stack" "crendetials_permission_template" { | ||
name = local.credentials_name | ||
parameters = data.tanzu-mission-control_permission_template.eks_permissions.template_values != null ? data.tanzu-mission-control_permission_template.eks_permissions.template_values : {} | ||
template_body = base64decode(data.tanzu-mission-control_permission_template.eks_permissions.template) | ||
capabilities = ["CAPABILITY_NAMED_IAM"] | ||
} | ||
resource "tanzu-mission-control_credential" "aws_eks_cred" { | ||
name = local.credentials_name | ||
spec { | ||
capability = local.tanzu_capability | ||
provider = local.tanzu_provider | ||
data { | ||
aws_credential { | ||
iam_role { | ||
arn = local.permission_arn | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `credentials_name` (String) The name of the credentials to get permission template for. | ||
- `tanzu_capability` (String) The Tanzu capability of the credentials. | ||
When tanzu_capability is set to 'DATA_PROTECTION' tanzu_provider must be set to 'AWS_EC2'. | ||
When tanzu_capability is set to 'MANAGED_K8S_PROVIDER' tanzu_provider must be set to 'AWS_EKS'. | ||
Valid values are: [DATA_PROTECTION MANAGED_K8S_PROVIDER] | ||
- `tanzu_provider` (String) The Tanzu provider of the credentials. | ||
When tanzu_provider is set to 'AWS_EC2' tanzu_capability must be set to 'DATA_PROTECTION'. | ||
When tanzu_provider is set to 'AWS_EKS' tanzu_capability must be set to 'MANAGED_K8S_PROVIDER'. | ||
Valid values are: [AWS_EC2 AWS_EKS] | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `template` (String) Base64 encoded permission template. | ||
- `template_url` (String) URL for permission template. | ||
- `template_values` (Map of String) Values to be sent as parameters for the template. | ||
- `undefined_template_values` (Map of String) Values which are not defined in the template parameters definition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.