Skip to content

Commit be222bc

Browse files
committed
Add networking tutorials (batch 19)
1 parent 49f07d9 commit be222bc

7 files changed

Lines changed: 382 additions & 0 deletions

File tree

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# ELB: Create an Application Load Balancer
2+
3+
Create an Application Load Balancer with a security group, target group, and HTTP listener using the default VPC.
4+
5+
## Source
6+
7+
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancer-getting-started.html
8+
9+
## Use case
10+
11+
- **ID**: elbv2/getting-started
12+
- **Level**: intermediate
13+
- **Core actions**: `elbv2:CreateLoadBalancer`, `elbv2:CreateListener`, `elbv2:CreateTargetGroup`
14+
15+
## Steps
16+
17+
1. Get VPC and subnets
18+
2. Create a security group
19+
3. Create a target group
20+
4. Create the Application Load Balancer
21+
5. Wait for ALB to be active
22+
6. Create an HTTP listener
23+
7. Describe the ALB
24+
25+
## Resources created
26+
27+
| Resource | Type |
28+
|----------|------|
29+
| `tut-alb-<random>` | Application Load Balancer |
30+
| `tut-tg-<random>` | Target group |
31+
| `tut-alb-sg-<random>` | Security group |
32+
| HTTP listener on port 80 | Listener |
33+
34+
## Duration
35+
36+
~121 seconds (most time spent waiting for ALB provisioning)
37+
38+
## Cost
39+
40+
~$0.02/hr while the ALB is running. Clean up promptly to avoid charges.
41+
42+
## Related docs
43+
44+
- [Getting started with Application Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancer-getting-started.html)
45+
- [Create an Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-application-load-balancer.html)
46+
- [Target groups for ALBs](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html)
47+
- [Elastic Load Balancing pricing](https://aws.amazon.com/elasticloadbalancing/pricing/)
48+
49+
---
50+
51+
## Appendix
52+
53+
| Field | Value |
54+
|-------|-------|
55+
| Date | 2026-04-14 |
56+
| Script lines | 112 |
57+
| Exit code | 0 |
58+
| Runtime | 121s |
59+
| Steps | 7 |
60+
| Issues | None |
61+
| Version | v1 |
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# Create an Application Load Balancer with Elastic Load Balancing
2+
3+
## Overview
4+
5+
In this tutorial, you use the AWS CLI to create an Application Load Balancer (ALB) in your default VPC. You create a security group, target group, and HTTP listener, then verify the ALB is active. You then delete all resources during cleanup.
6+
7+
## Prerequisites
8+
9+
- AWS CLI installed and configured with appropriate permissions.
10+
- A default VPC with at least two subnets in different Availability Zones.
11+
- An IAM principal with permissions for `elbv2:CreateLoadBalancer`, `elbv2:CreateTargetGroup`, `elbv2:CreateListener`, `elbv2:DescribeLoadBalancers`, `elbv2:DeleteLoadBalancer`, `elbv2:DeleteTargetGroup`, `elbv2:DeleteListener`, `ec2:CreateSecurityGroup`, `ec2:AuthorizeSecurityGroupIngress`, `ec2:DeleteSecurityGroup`, `ec2:DescribeVpcs`, and `ec2:DescribeSubnets`.
12+
13+
## Step 1: Get VPC and subnets
14+
15+
Identify the default VPC and select two subnets for the ALB. An ALB requires subnets in at least two Availability Zones.
16+
17+
```bash
18+
VPC_ID=$(aws ec2 describe-vpcs --filters "Name=isDefault,Values=true" \
19+
--query 'Vpcs[0].VpcId' --output text)
20+
21+
SUBNETS=$(aws ec2 describe-subnets --filters "Name=vpc-id,Values=$VPC_ID" \
22+
--query 'Subnets[:2].SubnetId' --output text)
23+
SUBNET1=$(echo "$SUBNETS" | awk '{print $1}')
24+
SUBNET2=$(echo "$SUBNETS" | awk '{print $2}')
25+
echo "VPC: $VPC_ID Subnets: $SUBNET1, $SUBNET2"
26+
```
27+
28+
## Step 2: Create a security group
29+
30+
Create a security group that allows inbound HTTP traffic on port 80.
31+
32+
```bash
33+
RANDOM_ID=$(openssl rand -hex 4)
34+
35+
SG_ID=$(aws ec2 create-security-group --group-name "tut-alb-sg-${RANDOM_ID}" \
36+
--description "Tutorial ALB security group" --vpc-id "$VPC_ID" \
37+
--query 'GroupId' --output text)
38+
39+
aws ec2 authorize-security-group-ingress --group-id "$SG_ID" \
40+
--protocol tcp --port 80 --cidr 0.0.0.0/0 > /dev/null
41+
echo "Security group: $SG_ID"
42+
```
43+
44+
This rule allows HTTP traffic from any source. In production, restrict the CIDR to known IP ranges.
45+
46+
## Step 3: Create a target group
47+
48+
Create an IP-based target group. The ALB forwards traffic to targets registered in this group.
49+
50+
```bash
51+
TG_NAME="tut-tg-${RANDOM_ID}"
52+
53+
TG_ARN=$(aws elbv2 create-target-group --name "$TG_NAME" \
54+
--protocol HTTP --port 80 --vpc-id "$VPC_ID" \
55+
--target-type ip \
56+
--query 'TargetGroups[0].TargetGroupArn' --output text)
57+
echo "Target group: $TG_ARN"
58+
```
59+
60+
Target type `ip` lets you register IP addresses directly. Use `instance` to register EC2 instances by ID instead.
61+
62+
## Step 4: Create the Application Load Balancer
63+
64+
Create the ALB across the two subnets with the security group attached.
65+
66+
```bash
67+
ALB_NAME="tut-alb-${RANDOM_ID}"
68+
69+
ALB_ARN=$(aws elbv2 create-load-balancer --name "$ALB_NAME" \
70+
--subnets $SUBNET1 $SUBNET2 \
71+
--security-groups "$SG_ID" \
72+
--query 'LoadBalancers[0].LoadBalancerArn' --output text)
73+
echo "ALB ARN: $ALB_ARN"
74+
```
75+
76+
## Step 5: Wait for ALB to be active
77+
78+
The ALB takes 1–2 minutes to provision. Wait for it to reach the `active` state.
79+
80+
```bash
81+
aws elbv2 wait load-balancer-available --load-balancer-arns "$ALB_ARN"
82+
83+
DNS_NAME=$(aws elbv2 describe-load-balancers --load-balancer-arns "$ALB_ARN" \
84+
--query 'LoadBalancers[0].DNSName' --output text)
85+
echo "DNS: $DNS_NAME"
86+
```
87+
88+
The DNS name is publicly resolvable. Without registered targets, requests to this DNS return a 503 error.
89+
90+
## Step 6: Create an HTTP listener
91+
92+
Create a listener on port 80 that forwards traffic to the target group.
93+
94+
```bash
95+
LISTENER_ARN=$(aws elbv2 create-listener --load-balancer-arn "$ALB_ARN" \
96+
--protocol HTTP --port 80 \
97+
--default-actions "Type=forward,TargetGroupArn=$TG_ARN" \
98+
--query 'Listeners[0].ListenerArn' --output text)
99+
echo "Listener: $LISTENER_ARN"
100+
```
101+
102+
The default action forwards all requests to the target group. You can add rules to route requests based on path or host header.
103+
104+
## Step 7: Describe the ALB
105+
106+
View the ALB configuration.
107+
108+
```bash
109+
aws elbv2 describe-load-balancers --load-balancer-arns "$ALB_ARN" \
110+
--query 'LoadBalancers[0].{Name:LoadBalancerName,DNS:DNSName,State:State.Code,Type:Type}' \
111+
--output table
112+
```
113+
114+
## Cleanup
115+
116+
Delete resources in reverse order. The ALB must be fully deleted before you can remove the target group.
117+
118+
```bash
119+
aws elbv2 delete-listener --listener-arn "$LISTENER_ARN"
120+
aws elbv2 delete-load-balancer --load-balancer-arn "$ALB_ARN"
121+
122+
echo "Waiting for ALB deletion..."
123+
aws elbv2 wait load-balancers-deleted --load-balancer-arns "$ALB_ARN"
124+
125+
aws elbv2 delete-target-group --target-group-arn "$TG_ARN"
126+
aws ec2 delete-security-group --group-id "$SG_ID"
127+
```
128+
129+
ALBs incur hourly charges (~$0.02/hr) plus data processing fees. Clean up promptly to avoid costs.
130+
131+
The script automates all steps including cleanup:
132+
133+
```bash
134+
bash elastic-load-balancing-gs.sh
135+
```
136+
137+
## Related resources
138+
139+
- [Getting started with Application Load Balancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancer-getting-started.html)
140+
- [Create an Application Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-application-load-balancer.html)
141+
- [Target groups for ALBs](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html)
142+
- [Elastic Load Balancing pricing](https://aws.amazon.com/elasticloadbalancing/pricing/)
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/bin/bash
2+
# Tutorial: Create an Application Load Balancer
3+
# Source: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancer-getting-started.html
4+
5+
WORK_DIR=$(mktemp -d)
6+
LOG_FILE="$WORK_DIR/elbv2-$(date +%Y%m%d-%H%M%S).log"
7+
exec > >(tee -a "$LOG_FILE") 2>&1
8+
9+
REGION=${AWS_DEFAULT_REGION:-${AWS_REGION:-$(aws configure get region 2>/dev/null)}}
10+
if [ -z "$REGION" ]; then
11+
echo "ERROR: No AWS region configured. Set one with: export AWS_DEFAULT_REGION=us-east-1"
12+
exit 1
13+
fi
14+
export AWS_DEFAULT_REGION="$REGION"
15+
echo "Region: $REGION"
16+
17+
RANDOM_ID=$(openssl rand -hex 4)
18+
ALB_NAME="tut-alb-${RANDOM_ID}"
19+
TG_NAME="tut-tg-${RANDOM_ID}"
20+
21+
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }
22+
trap 'handle_error $LINENO' ERR
23+
24+
cleanup() {
25+
echo ""
26+
echo "Cleaning up resources..."
27+
[ -n "$LISTENER_ARN" ] && aws elbv2 delete-listener --listener-arn "$LISTENER_ARN" 2>/dev/null && echo " Deleted listener"
28+
[ -n "$ALB_ARN" ] && aws elbv2 delete-load-balancer --load-balancer-arn "$ALB_ARN" 2>/dev/null && echo " Deleted ALB $ALB_NAME"
29+
# Wait for ALB to be deleted before deleting TG
30+
if [ -n "$ALB_ARN" ]; then
31+
echo " Waiting for ALB deletion..."
32+
aws elbv2 wait load-balancers-deleted --load-balancer-arns "$ALB_ARN" 2>/dev/null || sleep 30
33+
fi
34+
[ -n "$TG_ARN" ] && aws elbv2 delete-target-group --target-group-arn "$TG_ARN" 2>/dev/null && echo " Deleted target group $TG_NAME"
35+
[ -n "$SG_ID" ] && aws ec2 delete-security-group --group-id "$SG_ID" 2>/dev/null && echo " Deleted security group $SG_ID"
36+
rm -rf "$WORK_DIR"
37+
echo "Cleanup complete."
38+
}
39+
40+
# Step 1: Get VPC and subnets
41+
echo "Step 1: Getting VPC and subnets"
42+
VPC_ID=$(aws ec2 describe-vpcs --filters "Name=isDefault,Values=true" --query 'Vpcs[0].VpcId' --output text)
43+
SUBNETS=$(aws ec2 describe-subnets --filters "Name=vpc-id,Values=$VPC_ID" \
44+
--query 'Subnets[:2].SubnetId' --output text)
45+
SUBNET1=$(echo "$SUBNETS" | awk '{print $1}')
46+
SUBNET2=$(echo "$SUBNETS" | awk '{print $2}')
47+
echo " VPC: $VPC_ID"
48+
echo " Subnets: $SUBNET1, $SUBNET2"
49+
50+
# Step 2: Create security group
51+
echo "Step 2: Creating security group"
52+
SG_ID=$(aws ec2 create-security-group --group-name "tut-alb-sg-${RANDOM_ID}" \
53+
--description "Tutorial ALB security group" --vpc-id "$VPC_ID" \
54+
--query 'GroupId' --output text)
55+
aws ec2 authorize-security-group-ingress --group-id "$SG_ID" \
56+
--protocol tcp --port 80 --cidr 0.0.0.0/0 > /dev/null
57+
echo " Security group: $SG_ID (port 80 open)"
58+
59+
# Step 3: Create target group
60+
echo "Step 3: Creating target group: $TG_NAME"
61+
TG_ARN=$(aws elbv2 create-target-group --name "$TG_NAME" \
62+
--protocol HTTP --port 80 --vpc-id "$VPC_ID" \
63+
--target-type ip \
64+
--query 'TargetGroups[0].TargetGroupArn' --output text)
65+
echo " Target group ARN: $TG_ARN"
66+
67+
# Step 4: Create ALB
68+
echo "Step 4: Creating Application Load Balancer: $ALB_NAME"
69+
ALB_ARN=$(aws elbv2 create-load-balancer --name "$ALB_NAME" \
70+
--subnets $SUBNET1 $SUBNET2 \
71+
--security-groups "$SG_ID" \
72+
--query 'LoadBalancers[0].LoadBalancerArn' --output text)
73+
echo " ALB ARN: $ALB_ARN"
74+
75+
# Step 5: Wait for ALB to be active
76+
echo "Step 5: Waiting for ALB to be active..."
77+
aws elbv2 wait load-balancer-available --load-balancer-arns "$ALB_ARN"
78+
DNS_NAME=$(aws elbv2 describe-load-balancers --load-balancer-arns "$ALB_ARN" \
79+
--query 'LoadBalancers[0].DNSName' --output text)
80+
echo " DNS: $DNS_NAME"
81+
82+
# Step 6: Create listener
83+
echo "Step 6: Creating HTTP listener"
84+
LISTENER_ARN=$(aws elbv2 create-listener --load-balancer-arn "$ALB_ARN" \
85+
--protocol HTTP --port 80 \
86+
--default-actions "Type=forward,TargetGroupArn=$TG_ARN" \
87+
--query 'Listeners[0].ListenerArn' --output text)
88+
echo " Listener ARN: $LISTENER_ARN"
89+
90+
# Step 7: Describe the ALB
91+
echo "Step 7: ALB details"
92+
aws elbv2 describe-load-balancers --load-balancer-arns "$ALB_ARN" \
93+
--query 'LoadBalancers[0].{Name:LoadBalancerName,DNS:DNSName,State:State.Code,Type:Type}' --output table
94+
95+
echo ""
96+
echo "Tutorial complete."
97+
echo "The ALB is running but has no targets registered."
98+
echo "Note: ALBs incur hourly charges (~\$0.02/hr). Clean up promptly."
99+
echo ""
100+
echo "Do you want to clean up all resources? (y/n): "
101+
read -r CHOICE
102+
if [[ "$CHOICE" =~ ^[Yy]$ ]]; then
103+
cleanup
104+
else
105+
echo "Resources left running. ALB charges ~\$0.02/hr."
106+
echo "Manual cleanup:"
107+
echo " aws elbv2 delete-listener --listener-arn $LISTENER_ARN"
108+
echo " aws elbv2 delete-load-balancer --load-balancer-arn $ALB_ARN"
109+
echo " # Wait 1-2 minutes, then:"
110+
echo " aws elbv2 delete-target-group --target-group-arn $TG_ARN"
111+
echo " aws ec2 delete-security-group --group-id $SG_ID"
112+
fi
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/transfer.log") 2>&1
3+
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; echo "Region: $REGION"
4+
RANDOM_ID=$(openssl rand -hex 4)
5+
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }; trap 'handle_error $LINENO' ERR
6+
cleanup() { echo ""; echo "Cleaning up..."; [ -n "$SERVER_ID" ] && aws transfer delete-server --server-id "$SERVER_ID" 2>/dev/null && echo " Deleted server (takes ~1 min)"; rm -rf "$WORK_DIR"; echo "Done."; }
7+
echo "Step 1: Creating SFTP server"
8+
SERVER_ID=$(aws transfer create-server --protocols SFTP --endpoint-type PUBLIC --identity-provider-type SERVICE_MANAGED --query 'ServerId' --output text)
9+
echo " Server ID: $SERVER_ID"
10+
echo "Step 2: Waiting for server..."
11+
for i in $(seq 1 20); do STATUS=$(aws transfer describe-server --server-id "$SERVER_ID" --query 'Server.State' --output text); echo " $STATUS"; [ "$STATUS" = "ONLINE" ] && break; sleep 10; done
12+
echo "Step 3: Server details"
13+
aws transfer describe-server --server-id "$SERVER_ID" --query 'Server.{Id:ServerId,State:State,Endpoint:EndpointDetails.AddressAllocationIds,Protocols:Protocols}' --output table
14+
echo "Step 4: Listing servers"
15+
aws transfer list-servers --query 'Servers[:3].{Id:ServerId,State:State,Protocols:Protocols}' --output table
16+
echo ""; echo "Tutorial complete."
17+
echo "Note: Transfer Family servers incur hourly charges (~\$0.30/hr). Clean up promptly."
18+
echo "Do you want to clean up? (y/n): "; read -r CHOICE; [[ "$CHOICE" =~ ^[Yy]$ ]] && cleanup
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/datasync.log") 2>&1
3+
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; echo "Region: $REGION"
4+
echo "Step 1: Listing agents"
5+
aws datasync list-agents --query 'Agents[:5].{Arn:AgentArn,Name:Name,Status:Status}' --output table 2>/dev/null || echo " No agents configured"
6+
echo "Step 2: Listing locations"
7+
aws datasync list-locations --query 'Locations[:5].{Uri:LocationUri,Arn:LocationArn}' --output table 2>/dev/null || echo " No locations configured"
8+
echo "Step 3: Listing tasks"
9+
aws datasync list-tasks --query 'Tasks[:5].{Name:Name,Status:Status,Arn:TaskArn}' --output table 2>/dev/null || echo " No tasks configured"
10+
echo ""; echo "Tutorial complete. DataSync requires an agent (on-premises or EC2) for data transfer."
11+
echo "No resources created — this tutorial shows the DataSync API structure."
12+
rm -rf "$WORK_DIR"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/ga.log") 2>&1
3+
export AWS_DEFAULT_REGION=us-west-2; echo "Region: us-west-2 (Global Accelerator)"
4+
RANDOM_ID=$(openssl rand -hex 4); GA_NAME="tut-ga-${RANDOM_ID}"
5+
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }; trap 'handle_error $LINENO' ERR
6+
cleanup() { echo ""; echo "Cleaning up..."; [ -n "$GA_ARN" ] && { aws globalaccelerator update-accelerator --accelerator-arn "$GA_ARN" --no-enabled 2>/dev/null; sleep 5; aws globalaccelerator delete-accelerator --accelerator-arn "$GA_ARN" 2>/dev/null && echo " Deleted accelerator"; }; rm -rf "$WORK_DIR"; echo "Done."; }
7+
echo "Step 1: Creating accelerator: $GA_NAME"
8+
GA_ARN=$(aws globalaccelerator create-accelerator --name "$GA_NAME" --query 'Accelerator.AcceleratorArn' --output text)
9+
echo " ARN: $GA_ARN"
10+
echo "Step 2: Waiting for deployment..."
11+
for i in $(seq 1 20); do STATUS=$(aws globalaccelerator describe-accelerator --accelerator-arn "$GA_ARN" --query 'Accelerator.Status' --output text); echo " $STATUS"; [ "$STATUS" = "DEPLOYED" ] && break; sleep 10; done
12+
echo "Step 3: Accelerator details"
13+
aws globalaccelerator describe-accelerator --accelerator-arn "$GA_ARN" --query 'Accelerator.{Name:Name,Status:Status,DNS:DnsName,IPs:IpSets[0].IpAddresses}' --output table
14+
echo "Step 4: Listing accelerators"
15+
aws globalaccelerator list-accelerators --query 'Accelerators[?starts_with(Name, `tut-`)].{Name:Name,Status:Status}' --output table
16+
echo ""; echo "Tutorial complete."
17+
echo "Note: Global Accelerator incurs hourly charges. Clean up promptly."
18+
echo "Do you want to clean up? (y/n): "; read -r CHOICE; [[ "$CHOICE" =~ ^[Yy]$ ]] && cleanup
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
WORK_DIR=$(mktemp -d); exec > >(tee -a "$WORK_DIR/vpc-ep.log") 2>&1
3+
REGION=${AWS_DEFAULT_REGION:-$(aws configure get region 2>/dev/null)}; [ -z "$REGION" ] && echo "ERROR: No region" && exit 1; export AWS_DEFAULT_REGION="$REGION"; echo "Region: $REGION"
4+
RANDOM_ID=$(openssl rand -hex 4)
5+
VPC_ID=$(aws ec2 describe-vpcs --filters "Name=isDefault,Values=true" --query 'Vpcs[0].VpcId' --output text)
6+
handle_error() { echo "ERROR on line $1"; trap - ERR; cleanup; exit 1; }; trap 'handle_error $LINENO' ERR
7+
cleanup() { echo ""; echo "Cleaning up..."; [ -n "$EP_ID" ] && aws ec2 delete-vpc-endpoints --vpc-endpoint-ids "$EP_ID" > /dev/null 2>&1 && echo " Deleted endpoint"; rm -rf "$WORK_DIR"; echo "Done."; }
8+
echo "Step 1: Listing available VPC endpoint services"
9+
aws ec2 describe-vpc-endpoint-services --query 'ServiceNames[:10]' --output table
10+
echo "Step 2: Creating a gateway endpoint (S3)"
11+
RT_ID=$(aws ec2 describe-route-tables --filters "Name=vpc-id,Values=$VPC_ID" --query 'RouteTables[0].RouteTableId' --output text)
12+
EP_ID=$(aws ec2 create-vpc-endpoint --vpc-id "$VPC_ID" --service-name "com.amazonaws.${REGION}.s3" --route-table-ids "$RT_ID" --query 'VpcEndpoint.VpcEndpointId' --output text)
13+
echo " Endpoint: $EP_ID"
14+
echo "Step 3: Describing endpoint"
15+
aws ec2 describe-vpc-endpoints --vpc-endpoint-ids "$EP_ID" --query 'VpcEndpoints[0].{Id:VpcEndpointId,Service:ServiceName,State:State,Type:VpcEndpointType}' --output table
16+
echo "Step 4: Listing endpoints"
17+
aws ec2 describe-vpc-endpoints --filters "Name=vpc-id,Values=$VPC_ID" --query 'VpcEndpoints[].{Id:VpcEndpointId,Service:ServiceName,Type:VpcEndpointType}' --output table
18+
echo ""; echo "Tutorial complete."
19+
echo "Do you want to clean up? (y/n): "; read -r CHOICE; [[ "$CHOICE" =~ ^[Yy]$ ]] && cleanup

0 commit comments

Comments
 (0)