Skip to content

Commit f3f7335

Browse files
committed
OSDOCS-13576: Added info on rosa create network command
1 parent bcb1d8f commit f3f7335

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed

modules/rosa-hcp-create-network.adoc

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_hcp/rosa-hcp-sts-creating-a-cluster-quickly.adoc
4+
5+
ifeval::["{context}" == "rosa-hcp-egress-lockdown-install"]
6+
:egress-lockdown-rosa:
7+
endif::[]
8+
9+
:_mod-docs-content-type: PROCEDURE
10+
[id="rosa-hcp-create-network_{context}"]
11+
= Creating a Virtual Private Cloud using the ROSA CLI
12+
13+
The `rosa create network` command is available in v.1.2.48 or later of the ROSA CLI. This command uses AWS CloudFormation to create a VPC and other networking components used to install a ROSA cluster. CloudFormation is a native AWS infrastructure-as-code tool, compatible with the AWS CLI. For more information on AWS CloudFormation, see the additional resources.
14+
15+
If you do not specify a template, CloudFormation uses a default template that creates the following parameters:
16+
17+
[cols="2a,3a",options="header"]
18+
|===
19+
|VPC parameter
20+
|Value
21+
22+
| Availability Zones
23+
| 1
24+
25+
| Region
26+
| `us-west-2`
27+
28+
| VPC CIDR
29+
| `10.0.0.0/16`
30+
|===
31+
32+
You can create and customize CloudFormation templates can also be used with the command. See the additional resources for information on the Default VPC template.
33+
34+
.Prerequisites
35+
36+
* You have configured your AWS account
37+
* You have configured your Red Hat accounts
38+
* You have installed and configured the ROSA CLI to the latest version
39+
40+
.Procedure
41+
. Use the following command to create an AWS VPC using the default CloudFormations template:
42+
+
43+
[source,terminal]
44+
----
45+
$ rosa create network
46+
----
47+
48+
. To see a list of parameters available in the default template you can run:
49+
+
50+
[source,terminal]
51+
----
52+
$ rosa create network --help
53+
----
54+
55+
. Optional: If you want to modify a parameter, you can specify `--param Param1=Value1`, `--param Param2=Value2`, and so on. For example, if you wanted to modify the region, name, AZ count, and VPC's CIDR parameters, you could run:
56+
+
57+
[source,terminal]
58+
----
59+
$ rosa create network --param Region=us-west-2 --param Name=quickstart-stack --param AvailabilityZoneCount=1 --param VpcCidr=10.0.0.0/16
60+
----
61+
62+
. The full list of parameters available in the default template.
63+
+
64+
.Example template
65+
+
66+
[source,yaml]
67+
----
68+
Parameters:
69+
AvailabilityZoneCount:
70+
Type: Number
71+
Description: "Number of Availability Zones to use"
72+
Default: 1
73+
MinValue: 1
74+
MaxValue: 3
75+
Region:
76+
Type: String
77+
Description: "AWS Region"
78+
Default: "us-west-2"
79+
Name:
80+
Type: String
81+
Description: "Name prefix for resources"
82+
VpcCidr:
83+
Type: String
84+
Description: CIDR block for the VPC
85+
Default: '10.0.0.0/16'
86+
----
87+
+
88+
The command takes about 5 minutes to run, providing regular status updates from AWS as resources are created. If there is an issue with CloudFormation, a rollback will be attempted. If any other issues are encountered, please follow the error message instructions or contact AWS support.
89+
+
90+
[NOTE]
91+
====
92+
Save the subnet IDs that are created as a result of this command since these subnets are needed when creating the cluster. Replace `$SUBNET_IDS` in the `rosa cluster create` command below with these values in a comma-separated list.
93+
====
94+
95+
. To delete the Cloudformation stack that was created, run the following command:
96+
+
97+
[source,terminal]
98+
----
99+
$ aws cloudformation delete-stack --stack-name [Name]
100+
----
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_hcp/rosa-hcp-sts-creating-a-cluster-quickly.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="rosa-hcp-custom-create-network_{context}"]
7+
= Configuring and using custom CloudFormation templates
8+
9+
You can use a custom CloudFormation template by specifying a new directory with `--template-dir`, and then specifying a template name when you use `rosa create network`. You can also simply use the aws cloudformations command directly when using custom CloudFormation templates.
10+
11+
.Procedure
12+
13+
. Run the following command to use a CloudFormation template stored locally at `/rosa/templates/customtemplatename/cloudformation.yaml`:
14+
+
15+
[source,terminal]
16+
----
17+
$ rosa create network customtemplatename --template-dir='/rosa/templates'
18+
----
19+
+
20+
[NOTE]
21+
====
22+
The default directory is `/cmd/create/network/templates/rosa/`.
23+
24+
As with any VPC used for ROSA, the VPC created by this method is not managed by ROSA, and ROSA is not aware of its dependency on this VPC. If you manipulate the VPC while a ROSA cluster is running within it, you could introduce risk to the cluster.
25+
====

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

+13
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ To create a {hcp-title} cluster, you must have the following items:
7373

7474
You must have a Virtual Private Cloud (VPC) to create {hcp-title} cluster. You can use the following methods to create a VPC:
7575

76+
* Create a VPC using the ROSA CLI
7677
* Create a VPC by using a Terraform template
7778
* Manually create the VPC resources in the AWS console
7879

@@ -81,6 +82,18 @@ You must have a Virtual Private Cloud (VPC) to create {hcp-title} cluster. You c
8182
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`.
8283
====
8384

85+
[discrete]
86+
include::modules/rosa-hcp-create-network.adoc[leveloffset=+3]
87+
[discrete]
88+
include::modules/rosa-hcp-custom-create-network.adoc[leveloffset=+3]
89+
90+
[role="_additional-resources"]
91+
[id="additional-resources_rosa-hcp-create-network"]
92+
.Additional resources
93+
94+
* See the link:https://aws.amazon.com/cloudformation/[AWS CloudFormation] for more information about structuring CloudFormation files to create VPCs.
95+
* See this link:https://github.com/openshift/rosa/blob/master/cmd/create/network/templates/rosa-quickstart-default-vpc/cloudformation.yaml[default VPC AWS CloudFormation template] for more information.
96+
8497
[discrete]
8598
include::modules/rosa-hcp-vpc-terraform.adoc[leveloffset=+3]
8699

0 commit comments

Comments
 (0)