|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * rosa_hcp/rosa-hcp-creating-cluster-with-aws-kms-key.adoc |
| 4 | +// * rosa_hcp/rosa-hcp-egress-lockdown-install.adoc |
| 5 | +// * rosa_hcp/rosa-hcp-quickstart-guide.adoc |
| 6 | +// * rosa_hcp/rosa-hcp-sts-creating-a-cluster-quickly.adoc |
| 7 | + |
| 8 | +ifeval::["{context}" == "rosa-hcp-egress-lockdown-install"] |
| 9 | +:egress-lockdown-rosa: |
| 10 | +endif::[] |
| 11 | + |
| 12 | +:_mod-docs-content-type: PROCEDURE |
| 13 | +[id="rosa-hcp-create-network_{context}"] |
| 14 | += Creating a Virtual Private Cloud using the ROSA CLI |
| 15 | + |
| 16 | +The `rosa create network` command is available in v.1.2.48 or later of the ROSA command-line interface (CLI). The command uses AWS CloudFormation to create a VPC and the other networking components used to install a ROSA cluster. CloudFormation is a native AWS infrastructure-as-code tool and is compatible with the AWS CLI. |
| 17 | + |
| 18 | +If you do not specify a template, CloudFormation uses a default template that creates the following parameters: |
| 19 | + |
| 20 | +[cols="2a,3a",options="header"] |
| 21 | +|=== |
| 22 | +|VPC parameter |
| 23 | +|Value |
| 24 | + |
| 25 | +| Availability zones |
| 26 | +| 1 |
| 27 | + |
| 28 | +| Region |
| 29 | +| `us-east-1` |
| 30 | + |
| 31 | +| VPC CIDR |
| 32 | +| `10.0.0.0/16` |
| 33 | +|=== |
| 34 | + |
| 35 | +You can create and customize CloudFormation templates to use with the `rosa create network` command. See the additional resources for information on the default VPC template. |
| 36 | + |
| 37 | +.Prerequisites |
| 38 | + |
| 39 | +* You have configured your AWS account |
| 40 | +* You have configured your Red Hat accounts |
| 41 | +* You have installed the ROSA CLI and configured it to the latest version |
| 42 | +
|
| 43 | +.Procedure |
| 44 | +. Create an AWS VPC using the default CloudFormations template by running the following command: |
| 45 | ++ |
| 46 | +[source,terminal] |
| 47 | +---- |
| 48 | +$ rosa create network |
| 49 | +---- |
| 50 | + |
| 51 | +. Optional: If you want to modify a parameter, you can specify the parameter using optional argument flags such as `--param Param1=Value1` and `--param Param2=Value2`. For example, if you wanted to modify the region, name, availability zone (AZ) count, and VPC's CIDR parameters, you could run: |
| 52 | ++ |
| 53 | +[source,terminal] |
| 54 | +---- |
| 55 | +$ rosa create network --param Region=us-west-2 --param Name=quickstart-stack --param AvailabilityZoneCount=1 --param VpcCidr=10.0.0.0/16 |
| 56 | +---- |
| 57 | + |
| 58 | +. The full list of parameters is available in the default template. |
| 59 | ++ |
| 60 | +.Example template |
| 61 | ++ |
| 62 | +[source,yaml] |
| 63 | +---- |
| 64 | +Parameters: |
| 65 | + AvailabilityZoneCount: |
| 66 | + Type: Number |
| 67 | + Description: "Number of Availability Zones to use" |
| 68 | + Default: 1 |
| 69 | + MinValue: 1 |
| 70 | + MaxValue: 3 |
| 71 | + Region: |
| 72 | + Type: String |
| 73 | + Description: "AWS Region" |
| 74 | + Default: "us-west-2" |
| 75 | + Name: |
| 76 | + Type: String |
| 77 | + Description: "Name prefix for resources" |
| 78 | + VpcCidr: |
| 79 | + Type: String |
| 80 | + Description: CIDR block for the VPC |
| 81 | + Default: '10.0.0.0/16' |
| 82 | +---- |
| 83 | ++ |
| 84 | +The command takes about 5 minutes to run and provides regular status updates from AWS as resources are created. If there is an issue with CloudFormation, a rollback is attempted. For all other errors are encountered, please follow the error message instructions or contact AWS support. |
| 85 | + |
| 86 | +.Verification |
| 87 | +. When completed, you receive a summary of the created resources: |
| 88 | ++ |
| 89 | +[source,bash] |
| 90 | +---- |
| 91 | +INFO[0140] Resources created in stack: |
| 92 | +INFO[0140] Resource: AttachGateway, Type: AWS::EC2::VPCGatewayAttachment, ID: <gateway-id> |
| 93 | +INFO[0140] Resource: EC2VPCEndpoint, Type: AWS::EC2::VPCEndpoint, ID: <vpce-id> |
| 94 | +INFO[0140] Resource: EcrApiVPCEndpoint, Type: AWS::EC2::VPCEndpoint, ID: <vpce-id> |
| 95 | +INFO[0140] Resource: EcrDkrVPCEndpoint, Type: AWS::EC2::VPCEndpoint, ID: <vpce-id> |
| 96 | +INFO[0140] Resource: ElasticIP1, Type: AWS::EC2::EIP, ID: <IP> |
| 97 | +INFO[0140] Resource: ElasticIP2, Type: AWS::EC2::EIP, ID: <IP> |
| 98 | +INFO[0140] Resource: InternetGateway, Type: AWS::EC2::InternetGateway, ID: igw-016e1a71b9812464e |
| 99 | +INFO[0140] Resource: KMSVPCEndpoint, Type: AWS::EC2::VPCEndpoint, ID: <vpce-id> |
| 100 | +INFO[0140] Resource: NATGateway1, Type: AWS::EC2::NatGateway, ID: <nat-gateway-id> |
| 101 | +INFO[0140] Resource: PrivateRoute, Type: AWS::EC2::Route, ID: <route-id> |
| 102 | +INFO[0140] Resource: PrivateRouteTable, Type: AWS::EC2::RouteTable, ID: <route-id> |
| 103 | +INFO[0140] Resource: PrivateSubnetRouteTableAssociation1, Type: AWS::EC2::SubnetRouteTableAssociation, ID: <route-id> |
| 104 | +INFO[0140] Resource: PublicRoute, Type: AWS::EC2::Route, ID: <route-id> |
| 105 | +INFO[0140] Resource: PublicRouteTable, Type: AWS::EC2::RouteTable, ID: <route-id> |
| 106 | +INFO[0140] Resource: PublicSubnetRouteTableAssociation1, Type: AWS::EC2::SubnetRouteTableAssociation, ID: <route-id> |
| 107 | +INFO[0140] Resource: S3VPCEndpoint, Type: AWS::EC2::VPCEndpoint, ID: <vpce-id> |
| 108 | +INFO[0140] Resource: STSVPCEndpoint, Type: AWS::EC2::VPCEndpoint, ID: <vpce-id> |
| 109 | +INFO[0140] Resource: SecurityGroup, Type: AWS::EC2::SecurityGroup, ID: <security-group-id> |
| 110 | +INFO[0140] Resource: SubnetPrivate1, Type: AWS::EC2::Subnet, ID: <private-subnet-id-1> \ <1> |
| 111 | +INFO[0140] Resource: SubnetPublic1, Type: AWS::EC2::Subnet, ID: <public-subnet-id-1> \ <1> |
| 112 | +INFO[0140] Resource: VPC, Type: AWS::EC2::VPC, ID: <vpc-id> |
| 113 | +INFO[0140] Stack rosa-network-stack-5555 created \ <2> |
| 114 | +---- |
| 115 | ++ |
| 116 | +-- |
| 117 | +<1> These two subnet IDs are used to create your cluster when using the `rosa create cluster` command. |
| 118 | +<2> The network stack name is used to delete the resource later. |
0 commit comments