Skip to content

Commit 4014340

Browse files
authored
Merge pull request #947 from ironcladlou/govcloud-billing-id
OCM-17691 | fix: Make billing account ID optional to enable GovCloud HCP cluster creation
2 parents ba7bdd7 + a36fdfc commit 4014340

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

docs/resources/cluster_rosa_hcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ resource "rhcs_cluster_rosa_hcp" "rosa_sts_cluster" {
5151

5252
- `availability_zones` (List of String) Availability zones. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md)
5353
- `aws_account_id` (String) Identifier of the AWS account. After the creation of the resource, it is not possible to update the attribute value.
54-
- `aws_billing_account_id` (String) Identifier of the AWS account for billing. After the creation of the resource, it is not possible to update the attribute value.
5554
- `aws_subnet_ids` (List of String) AWS subnet IDs. After the creation of the resource, it is not possible to update the attribute value.
5655
- `cloud_region` (String) AWS region identifier, for example 'us-east-1'.
5756
- `name` (String) Name of the cluster. Cannot exceed 54 characters in length. After the creation of the resource, it is not possible to update the attribute value.
@@ -62,6 +61,7 @@ resource "rhcs_cluster_rosa_hcp" "rosa_sts_cluster" {
6261
- `admin_credentials` (Attributes) Admin user credentials. After the creation of the resource, it is not possible to update the attribute value. (see [below for nested schema](#nestedatt--admin_credentials))
6362
- `aws_additional_allowed_principals` (List of String) AWS additional allowed principals.
6463
- `aws_additional_compute_security_group_ids` (List of String) AWS additional compute security group ids.
64+
- `aws_billing_account_id` (String) Identifier of the AWS account for billing. After the creation of the resource, it is not possible to update the attribute value.
6565
- `base_dns_domain` (String) Base DNS domain name previously reserved, e.g. '1vo8.p3.openshiftapps.com'. After the creation of the resource, it is not possible to update the attribute value.
6666
- `channel_group` (String) Name of the channel group where you select the OpenShift cluster version, for example 'stable'. For ROSA, only 'stable' is supported. After the creation of the resource, it is not possible to update the attribute value.
6767
- `compute_machine_type` (String) Identifies the machine type used by the initial worker nodes, for example `m5.xlarge`. Use the `rhcs_machine_types` data source to find the possible values. This attribute specifically applies to the Worker Machine Pool and becomes irrelevant once the resource is created. Any modifications to the initial Machine Pool should be made through the Terraform imported Machine Pool resource. For more details, refer to [Worker Machine Pool in ROSA Cluster](../guides/worker-machine-pool.md)

internal/ocm/resource/cluster.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ func (c *Cluster) CreateAWSBuilder(clusterTopology rosaTypes.ClusterTopology,
181181
if err != nil {
182182
return err
183183
}
184-
awsBuilder.BillingAccountID(*awsBillingAccountId)
184+
if awsBillingAccountId != nil {
185+
awsBuilder.BillingAccountID(*awsBillingAccountId)
186+
}
185187
}
186188

187189
if awsAccountID != nil {

provider/clusterrosa/hcp/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func (r *ClusterRosaHcpResource) Schema(ctx context.Context, req resource.Schema
209209
},
210210
"aws_billing_account_id": schema.StringAttribute{
211211
Description: "Identifier of the AWS account for billing. " + common.ValueCannotBeChangedStringDescription,
212-
Required: true,
212+
Optional: true,
213213
Validators: []validator.String{
214214
stringvalidator.RegexMatches(regexp.MustCompile(`^\d{12}$`), "aws billing account ID must be only digits and exactly 12 in length"),
215215
},

0 commit comments

Comments
 (0)