Skip to content

Commit 408e20b

Browse files
authored
Merge pull request #60702 from EricPonvelle/OSDOCS-6315_Update-Terraform
OSDOCS-6315: Updated Terraform VPC path
2 parents 48a884f + bc6bffc commit 408e20b

File tree

5 files changed

+74
-29
lines changed

5 files changed

+74
-29
lines changed

modules/rosa-hcp-byo-oidc.adoc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ endif::rosa-classic[]
3232
+
3333
[source,terminal]
3434
----
35-
$ rosa create oidc-config --mode=auto
35+
$ rosa create oidc-config --mode=auto --yes
3636
----
3737
+
3838
This command returns the following information.
@@ -53,6 +53,27 @@ I: Created OIDC provider with ARN 'arn:aws:iam::4540112244:oidc-provider/dvbwgdz
5353
+
5454
When creating your cluster, you must supply the OIDC config ID. The CLI output provides this value for `--mode auto`, otherwise you must determine these values based on `aws` CLI output for `--mode manual`.
5555
56+
* Optional: you can save the OIDC configuration ID as a variable to use later. Run the following command to save the variable:
57+
+
58+
[source,terminal]
59+
----
60+
$ export OIDC_ID=30f5dqmk
61+
----
62+
63+
. View the value of the variable by running with the following command:
64+
+
65+
[source,terminal]
66+
----
67+
$ echo $OIDC_ID
68+
----
69+
+
70+
.Sample output
71+
+
72+
[source,terminal]
73+
----
74+
$ 30f5dqmk
75+
----
76+
5677
.Verification
5778

5879
. You can list the possible OIDC configurations available for your clusters that are associated with your user organization. Run the following command:

modules/rosa-hcp-sts-creating-a-cluster-cli.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ When using {product-title} (ROSA) CLI (`rosa`) to create a cluster, you can sele
1717
+
1818
[NOTE]
1919
====
20-
To successfully install ROSA clusters, use the latest version of the ROSA CLI (`rosa`).
20+
To successfully install ROSA clusters, use the latest version of the ROSA CLI (`rosa`). Run `rosa version` to see your currently installed version of the ROSA CLI. If a newer version is available, the CLI provides a link to download this upgrade.
2121
====
22+
2223
* You have logged in to your Red Hat account by using the ROSA CLI.
2324
* You have created an OIDC configuration.
2425
* You have verified that the AWS Elastic Load Balancing (ELB) service role exists in your AWS account.
@@ -52,6 +53,13 @@ $ rosa create cluster --private --cluster-name=<cluster_name> \
5253
--sts --mode=auto --hosted-cp --subnet-ids=<private-subnet-id>
5354
----
5455

56+
** If you used variables like `OIDC_ID` and `SUBNET_IDS`, you can use those references when creating your cluster. For example, run the following command:
57+
+
58+
[source,terminal]
59+
----
60+
$ rosa create cluster --hosted-cp --subnet-ids=$SUBNET_IDS --oidc-config-id=$OIDC_ID --cluster-name=<cluster_name>
61+
----
62+
5563
. Check the status of your cluster by running the following command:
5664
+
5765
[source,terminal]

modules/rosa-hcp-vpc-terraform.adoc

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,26 @@ Terraform is a tool that allows you to create various resources using an establi
1010

1111
.Prerequisites
1212

13-
* You have installed Terraform on your machine.
13+
* You have installed Terraform version 1.4.0 or newer on your machine.
14+
* You have installed Git on your machine.
1415
1516
.Procedure
1617

17-
. Open a shell prompt and create a directory for your Terraform files by running the following command:
18+
. Open a shell prompt and clone the Terraform VPC repository by running the following command:
1819
+
1920
[source,terminal]
2021
----
21-
$ mkdir hypershift-tf
22+
$ git clone https://github.com/openshift-cs/terraform-vpc-example
2223
----
2324

2425
. Navigate to the created directory by running the following command:
2526
+
2627
[source,terminal]
2728
----
28-
$ cd hypershift-tf
29+
$ cd terraform-vpc-example
2930
----
3031

31-
. Download the VPC setup Terraform file by running the following command:
32-
+
33-
[source,terminal]
34-
----
35-
$ curl -s -o setup-vpc.tf https://raw.githubusercontent.com/openshift-cs/OpenShift-Troubleshooting-Templates/master/rosa-hcp-terraform/setup-vpc.tf
36-
----
37-
38-
. After the template has downloaded, initiate the Terraform file by running the following command:
32+
. Initiate the Terraform file by running the following command:
3933
+
4034
[source,terminal]
4135
----
@@ -44,37 +38,39 @@ $ terraform init
4438
+
4539
A message confirming the initialization appears when this process completes.
4640

47-
. To build your VPC Terraform plan based off of the downloaded template, run the `plan` command. You must include your AWS region. Optionally, you can specify a cluster name.
41+
. To build your VPC Terraform plan based on the existing Terraform template, run the `plan` command. You must include your AWS region. You can choose to specify a cluster name. A `rosa.tfplan` file is added to the `hypershift-tf` directory after the `terraform plan` completes. For more detailed options, see the link:https://github.com/openshift-cs/terraform-vpc-example/blob/main/README.md[Terraform VPC repository's README file].
4842
+
4943
[source,terminal]
5044
----
51-
$ terraform plan -out rosa.plan -var aws_region=<region> [-var cluster_name=<cluster_name>]
45+
$ terraform plan -out rosa.tfplan -var region=<region> [-var cluster_name=<cluster_name>]
5246
----
5347

54-
. You should have a `rosa.plan` file in the directory that you created in the first step. Apply this plan file to build your VPC by running the following command:
48+
. Apply this plan file to build your VPC by running the following command:
5549
+
5650
[source,terminal]
5751
----
58-
$ terraform apply rosa.plan
52+
$ terraform apply rosa.tfplan
5953
----
6054

6155
. Optional: You can capture the values of the Terraform-provisioned private, public, and machinepool subnet IDs as environment variables to use when creating your {hcp-title} cluster by running the following commands:
6256
+
63-
** For the private subnet ID:
64-
+
6557
[source,terminal]
6658
----
67-
$ PRIVATE_SUBNET=`terraform output -raw cluster-private-subnet`
59+
$ export SUBNET_IDS=$(terraform output -raw cluster-subnets-string)
6860
----
69-
** For the public subnet ID:
61+
62+
.Verification
63+
64+
* You can verify that the variables were correctly set with the following command:
7065
+
7166
[source,terminal]
7267
----
73-
$ PUBLIC_SUBNET=`terraform output -raw cluster-public-subnet`
68+
$ echo $SUBNET_IDS
7469
----
75-
** For the machinepool subnet ID:
70+
+
71+
.Sample output
7672
+
7773
[source,terminal]
7874
----
79-
$ MACHINEPOOL_SUBNET=`terraform output -raw node-private-subnet`
75+
$ subnet-0a6a57e0f784171aa,subnet-078e84e5b10ecf5b0
8076
----

modules/rosa-operator-config.adoc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ When using a {hcp-title} cluster, you must create the Operator IAM roles that ar
2020
+
2121
[source,terminal]
2222
----
23-
$ rosa create operator-roles --prefix <prefix-name> <1>
23+
$ rosa create operator-roles --hosted-cp --prefix <prefix-name> --oidc-config-id <oidc-config-id>
24+
----
25+
+
26+
The following breakdown provides options for the Operator role creation.
27+
+
28+
[source,terminal]
29+
----
30+
$ rosa create operator-roles --hosted-cp
31+
--prefix <prefix-name> <1>
2432
--oidc-config-id <oidc-config-id> <2>
25-
--hosted-cp
2633
----
2734
+
2835
--
29-
<1> You must supply a prefix when creating these Operator roles. Failing to do so produces an error.
36+
<1> You must supply a prefix when creating these Operator roles. Failing to do so produces an error. See the Additional resources of this section for information on the Operator prefix.
3037
<2> This value is the OIDC configuration ID that you created for your {hcp-title} cluster.
3138
--
3239
+

rosa_hcp/rosa-hcp-sts-creating-a-cluster-quickly.adoc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,18 @@ You must have a Virtual Private Cloud (VPC) to create {hcp-title} cluster. You c
7979

8080
[NOTE]
8181
====
82-
The Terraform instructions are for testing and demonstration purposes. Your own installation requires some modifications to the VPC for your own use.
82+
The Terraform instructions are for testing and demonstration purposes. Your own installation requires some modifications to the VPC for your own use. You should also ensure that when you use this Terraform script it is in the same region that you intend to install your cluster. In these examples, use `us-east-2`.
8383
====
8484

8585
[discrete]
8686
include::modules/rosa-hcp-vpc-terraform.adoc[leveloffset=+3]
87+
88+
[role="_additional-resources"]
89+
[id="additional-resources_rosa-hcp-vpc-terraform"]
90+
.Additional resources
91+
92+
* See the link:https://github.com/openshift-cs/terraform-vpc-example[Terraform VPC] repository for a detailed list of all options available when customizing the VPC for your needs.
93+
8794
[discrete]
8895
include::modules/rosa-hcp-vpc-manual.adoc[leveloffset=+3]
8996

@@ -100,6 +107,12 @@ include::modules/rosa-hcp-byo-oidc.adoc[leveloffset=+2]
100107

101108
include::modules/rosa-operator-config.adoc[leveloffset=+2]
102109

110+
[role="_additional-resources"]
111+
[id="additional-resources_rosa-hcp-operator-prefix"]
112+
.Additional resources
113+
114+
* See xref:../rosa_architecture/rosa-sts-about-iam-resources.adoc#rosa-sts-about-operator-role-prefixes_rosa-sts-about-iam-resources[About custom Operator IAM role prefixes] for information on the Operator prefixes.
115+
103116
include::modules/rosa-hcp-sts-creating-a-cluster-cli.adoc[leveloffset=+1]
104117

105118
[id="next-steps-2_{context}"]

0 commit comments

Comments
 (0)