Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions docs/user/aws/install_existing_vpc_local-zones.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. It's not a necessity to nix jq from this repo, but it's helpful if the commands here are as similar to what makes it into the user docs as possible.

I will work these into openshift/openshift-docs#57427 this week.

Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,23 @@ aws cloudformation wait stack-create-complete \

```bash
export VPC_ID=$(aws cloudformation describe-stacks \
--region us-west-2 \
--stack-name ${CLUSTER_NAME}-vpc \
| jq -r '.Stacks[0].Outputs[] | select(.OutputKey=="VpcId").OutputValue' )
--region ${AWS_REGION} --stack-name ${CLUSTER_NAME}-vpc \
--query 'Stacks[0].Outputs[?OutputKey==`VpcId`].OutputValue' --output text)
```

- Extract the subnets IDs to the environment variable list `SUBNETS`:

```bash
mapfile -t SUBNETS < <(aws cloudformation describe-stacks \
--region us-west-2 \
--region ${AWS_REGION} \
--stack-name ${CLUSTER_NAME}-vpc \
| jq -r '.Stacks[0].Outputs[0].OutputValue' | tr ',' '\n')
--query 'Stacks[0].Outputs[?OutputKey==`PrivateSubnetIds`].OutputValue' \
--output text | tr ',' '\n')
mapfile -t -O "${#SUBNETS[@]}" SUBNETS < <(aws cloudformation describe-stacks \
--region us-west-2 \
--region ${AWS_REGION} \
--stack-name ${CLUSTER_NAME}-vpc \
| jq -r '.Stacks[0].Outputs[1].OutputValue' | tr ',' '\n')
--query 'Stacks[0].Outputs[?OutputKey==`PublicSubnetIds`].OutputValue' \
--output text | tr ',' '\n')
```

- Export the Public Route Table ID:
Expand All @@ -139,7 +140,7 @@ mapfile -t -O "${#SUBNETS[@]}" SUBNETS < <(aws cloudformation describe-stacks \
export PUBLIC_RTB_ID=$(aws cloudformation describe-stacks \
--region us-west-2 \
--stack-name ${CLUSTER_NAME}-vpc \
| jq -r '.Stacks[0].Outputs[] | select(.OutputKey=="PublicRouteTableId").OutputValue' )
--query 'Stacks[0].Outputs[?OutputKey==`PublicRouteTableId`].OutputValue' --output text)
```

- Make sure all variables have been correctly set:
Expand Down Expand Up @@ -201,7 +202,7 @@ aws cloudformation wait stack-create-complete \
export SUBNET_ID=$(aws cloudformation describe-stacks \
--region ${AWS_REGION} \
--stack-name ${SUBNET_NAME} \
| jq -r '.Stacks[0].Outputs[] | select(.OutputKey=="PublicSubnetIds").OutputValue' )
--query 'Stacks[0].Outputs[?OutputKey==`PublicSubnetIds`].OutputValue' --output text)

# Append the Local Zone Subnet ID to the Subnet List
SUBNETS+=(${SUBNET_ID})
Expand Down