-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CDPCP-13058 - Allow in-place update of AWS credential (#176)
- Loading branch information
Showing
9 changed files
with
198 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cdp_dw_database_catalog Resource - terraform-provider-cdp" | ||
subcategory: "" | ||
description: |- | ||
Creates an AWS Data Warehouse database catalog. | ||
--- | ||
|
||
# cdp_dw_database_catalog (Resource) | ||
|
||
Creates an AWS Data Warehouse database catalog. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cluster_id` (String) The unique identifier of the cluster. | ||
|
||
### Optional | ||
|
||
- `polling_options` (Attributes) Polling related configuration options that could specify various values that will be used during CDP resource creation. (see [below for nested schema](#nestedatt--polling_options)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
- `last_updated` (String) Timestamp of the last Terraform update of the order. | ||
- `name` (String) The name of the database catalog. | ||
- `status` (String) The status of the database catalog. | ||
|
||
<a id="nestedatt--polling_options"></a> | ||
### Nested Schema for `polling_options` | ||
|
||
Optional: | ||
|
||
- `async` (Boolean) Boolean value that specifies if Terraform should wait for resource creation/deletion. | ||
- `call_failure_threshold` (Number) Threshold value that specifies how many times should a single call failure happen before giving up the polling. | ||
- `polling_timeout` (Number) Timeout value in minutes that specifies for how long should the polling go for resource creation/deletion. | ||
|
||
|
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,23 @@ | ||
// Copyright 2024 Cloudera. All Rights Reserved. | ||
// | ||
// This file is licensed under the Apache License Version 2.0 (the "License"). | ||
// You may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | ||
// OF ANY KIND, either express or implied. Refer to the License for the specific | ||
// permissions and limitations governing your use of the file. | ||
|
||
package environments | ||
|
||
import "github.com/hashicorp/terraform-plugin-framework/types" | ||
|
||
type awsCredentialResourceModel struct { | ||
ID types.String `tfsdk:"id"` | ||
Crn types.String `tfsdk:"crn"` | ||
RoleArn types.String `tfsdk:"role_arn"` | ||
Description types.String `tfsdk:"description"` | ||
CredentialName types.String `tfsdk:"credential_name"` | ||
VerifyPermissions types.Bool `tfsdk:"verify_permissions"` | ||
SkipOrgPolicyDecisions types.Bool `tfsdk:"skip_org_policy_decisions"` | ||
} |
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,68 @@ | ||
// Copyright 2024 Cloudera. All Rights Reserved. | ||
// | ||
// This file is licensed under the Apache License Version 2.0 (the "License"). | ||
// You may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. | ||
// | ||
// This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS | ||
// OF ANY KIND, either express or implied. Refer to the License for the specific | ||
// permissions and limitations governing your use of the file. | ||
|
||
package environments | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/hashicorp/terraform-plugin-framework/resource" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" | ||
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" | ||
) | ||
|
||
func (r *awsCredentialResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { | ||
resp.Schema = schema.Schema{ | ||
MarkdownDescription: "The AWS credential is used for authorization to provision resources such as compute instances within your cloud provider account.", | ||
Attributes: map[string]schema.Attribute{ | ||
"id": schema.StringAttribute{ | ||
Computed: true, | ||
PlanModifiers: []planmodifier.String{ | ||
stringplanmodifier.UseStateForUnknown(), | ||
}, | ||
}, | ||
"credential_name": schema.StringAttribute{ | ||
Required: true, | ||
PlanModifiers: []planmodifier.String{ | ||
stringplanmodifier.RequiresReplace(), | ||
}, | ||
}, | ||
"role_arn": schema.StringAttribute{ | ||
Required: true, | ||
}, | ||
"description": schema.StringAttribute{ | ||
Optional: true, | ||
PlanModifiers: []planmodifier.String{ | ||
stringplanmodifier.RequiresReplaceIfConfigured(), | ||
}, | ||
}, | ||
"skip_org_policy_decisions": schema.BoolAttribute{ | ||
Optional: true, | ||
Computed: true, | ||
Default: booldefault.StaticBool(false), | ||
MarkdownDescription: "Whether to skip organizational policy decision checks or not.", | ||
}, | ||
"verify_permissions": schema.BoolAttribute{ | ||
Optional: true, | ||
Computed: true, | ||
Default: booldefault.StaticBool(false), | ||
MarkdownDescription: "Whether to verify permissions upon saving or not.", | ||
}, | ||
"crn": schema.StringAttribute{ | ||
Computed: true, | ||
PlanModifiers: []planmodifier.String{ | ||
stringplanmodifier.UseStateForUnknown(), | ||
}, | ||
}, | ||
}, | ||
} | ||
} |