Skip to content

Create VPC Endpoints

Using AWS CLI

AWS CLI v2

$VPC_ID = ""
$SUBNET_IDS = ("", "")
$SECURITY_GROUP_ID = ""
$PROJECT_NAME = ""
$REGION = ""

$ENDPOINT_LIST = @(
    ("sts-ep", "sts"),
    ("monitoring-ep", "monitoring")
)

foreach ($item in $ENDPOINT_LIST) {
    aws ec2 create-vpc-endpoint `
    --vpc-endpoint-type Interface `
    --vpc-id $VPC_ID `
    --service-name com.amazonaws.$REGION.$($item[1]) `
    --subnet-ids $SUBNET_IDS `
    --security-group-ids $SECURITY_GROUP_ID `
    --ip-address-type ipv4 `
    --tag-specifications "ResourceType=vpc-endpoint,Tags=[{Key=Name,Value=$($item[0])},{Key=project,Value=$PROJECT_NAME}]" `
    --region $REGION `
    --no-cli-pager
}
VPC_ID=""
SUBNET_IDS=""
SECURITY_GROUP_ID=""
PROJECT_NAME=""
REGION=""

ENDPOINT_LIST=(
    "sts-ep sts"
    "monitoring-ep monitoring"
)

for item in "${ENDPOINT_LIST[@]}"
do
    read -ra list <<< "$item"

    aws ec2 create-vpc-endpoint \
        --vpc-endpoint-type Interface \
        --vpc-id $VPC_ID \
        --service-name com.amazonaws.$REGION.${list[1]} \
        --subnet-ids $SUBNET_IDS \
        --security-group-ids $SECURITY_GROUP_ID \
        --ip-address-type ipv4 \
        --tag-specifications "ResourceType=vpc-endpoint,Tags=[{Key=Name,Value=${list[0]}},{Key=project,Value=$PROJECT_NAME}]" \
        --region $REGION \
        --no-cli-pager
done

AWS CLI v1

$VPC_ID = ""
$SUBNET_IDS = ("", "")
$SECURITY_GROUP_ID = ""
$PROJECT_NAME = ""
$REGION = ""

$ENDPOINT_LIST = @(
    ("sts-ep", "sts"),
    ("monitoring-ep", "monitoring")
)

foreach ($item in $ENDPOINT_LIST) {
    aws ec2 create-vpc-endpoint `
    --vpc-endpoint-type Interface `
    --vpc-id $VPC_ID `
    --service-name com.amazonaws.$REGION.$($item[1]) `
    --subnet-ids $SUBNET_IDS `
    --security-group-ids $SECURITY_GROUP_ID `
    --tag-specifications "ResourceType=vpc-endpoint,Tags=[{Key=Name,Value=$($item[0])},{Key=project,Value=$PROJECT_NAME}]" `
    --region $REGION
}
VPC_ID=""
SUBNET_IDS=""
SECURITY_GROUP_ID=""
PROJECT_NAME=""
REGION=""

ENDPOINT_LIST=(
    "sts-ep sts"
    "monitoring-ep monitoring"
)

for item in "${ENDPOINT_LIST[@]}"
do
    read -ra list <<< "$item"

    aws ec2 create-vpc-endpoint \
        --vpc-endpoint-type Interface \
        --vpc-id $VPC_ID \
        --service-name com.amazonaws.$REGION.${list[1]} \
        --subnet-ids $SUBNET_IDS \
        --security-group-ids $SECURITY_GROUP_ID \
        --tag-specifications "ResourceType=vpc-endpoint,Tags=[{Key=Name,Value=${list[0]}},{Key=project,Value=$PROJECT_NAME}]" \
        --region $REGION
done

Endpoints List

AWS Documentation

AWS service Service name Service name (short)
Access Analyzer com.amazonaws.region.access-analyzer access-analyzer
AWS Account Management com.amazonaws.region.account account
Amazon API Gateway com.amazonaws.region.execute-api execute-api
AWS App Mesh com.amazonaws.region.appmesh-envoy-management appmesh-envoy-management
AWS App Runner com.amazonaws.region.apprunner apprunner
AWS App Runner services com.amazonaws.region.apprunner.requests apprunner.requests
Application Auto Scaling com.amazonaws.region.application-autoscaling application-autoscaling
AWS Application Migration Service com.amazonaws.region.mgn mgn
Amazon AppStream 2.0 com.amazonaws.region.appstream.api appstream.api
com.amazonaws.region.appstream.streaming appstream.streaming
Amazon Athena com.amazonaws.region.athena athena
AWS Audit Manager com.amazonaws.region.auditmanager auditmanager
Amazon Aurora com.amazonaws.region.rds rds
AWS Auto Scaling com.amazonaws.region.autoscaling-plans autoscaling-plans
AWS Backup com.amazonaws.region.backup backup
com.amazonaws.region.backup-gateway backup-gateway
AWS Batch com.amazonaws.region.batch batch
AWS Billing Conductor com.amazonaws.region.billingconductor billingconductor
Amazon Braket com.amazonaws.region.braket braket
AWS Private Certificate Authority com.amazonaws.region.acm-pca acm-pca
AWS Cloud Control API com.amazonaws.region.cloudcontrolapi cloudcontrolapi
com.amazonaws.region.cloudcontrolapi-fips cloudcontrolapi-fips
Amazon Cloud Directory com.amazonaws.region.clouddirectory clouddirectory
AWS CloudFormation com.amazonaws.region.cloudformation cloudformation
AWS CloudHSM com.amazonaws.region.cloudhsmv2 cloudhsmv2
AWS CloudTrail com.amazonaws.region.cloudtrail cloudtrail
Amazon CloudWatch com.amazonaws.region.evidently evidently
com.amazonaws.region.evidently-dataplane evidently-dataplane
com.amazonaws.region.monitoring monitoring
com.amazonaws.region.rum rum
com.amazonaws.region.rum-dataplane rum-dataplane
com.amazonaws.region.synthetics synthetics
Amazon CloudWatch Events com.amazonaws.region.events events
Amazon CloudWatch Logs com.amazonaws.region.logs logs
AWS CodeArtifact com.amazonaws.region.codeartifact.api codeartifact.api
com.amazonaws.region.codeartifact.repositories codeartifact.repositories
AWS CodeBuild com.amazonaws.region.codebuild codebuild
com.amazonaws.region.codebuild-fips codebuild-fips
AWS CodeCommit com.amazonaws.region.codecommit codecommit
com.amazonaws.region.codecommit-fips codecommit-fips
com.amazonaws.region.git-codecommit git-codecommit
com.amazonaws.region.git-codecommit-fips git-codecommit-fips
AWS CodeDeploy com.amazonaws.region.codedeploy codedeploy
com.amazonaws.region.codedeploy-commands-secure codedeploy-commands-secure
Amazon CodeGuru Profiler com.amazonaws.region.codeguru-profiler codeguru-profiler
Amazon CodeGuru Reviewer com.amazonaws.region.codeguru-reviewer codeguru-reviewer
AWS CodePipeline com.amazonaws.region.codepipeline codepipeline
AWS CodeStar Connections com.amazonaws.region.codestar-connections.api codestar-connections.api
Amazon Comprehend com.amazonaws.region.comprehend comprehend
Amazon Comprehend Medical com.amazonaws.region.comprehendmedical comprehendmedical
AWS Config com.amazonaws.region.config config
Amazon Connect com.amazonaws.region.app-integrations app-integrations
com.amazonaws.region.cases cases
com.amazonaws.region.connect-campaigns connect-campaigns
com.amazonaws.region.profile profile
com.amazonaws.region.voiceid voiceid
com.amazonaws.region.wisdom wisdom
AWS Data Exchange com.amazonaws.region.dataexchange dataexchange
AWS Database Migration Service com.amazonaws.region.dms dms
com.amazonaws.region.dms-fips dms-fips
AWS DataSync com.amazonaws.region.datasync datasync
Amazon DevOps Guru com.amazonaws.region.devops-guru devops-guru
Amazon EBS direct APIs com.amazonaws.region.ebs ebs
Amazon EC2 com.amazonaws.region.ec2 ec2
Amazon EC2 Auto Scaling com.amazonaws.region.autoscaling autoscaling
EC2 Image Builder com.amazonaws.region.imagebuilder imagebuilder
Amazon ECR com.amazonaws.region.ecr.api ecr.api
com.amazonaws.region.ecr.dkr ecr.dkr
Amazon ECS com.amazonaws.region.ecs ecs
com.amazonaws.region.ecs-agent ecs-agent
com.amazonaws.region.ecs-telemetry ecs-telemetry
Amazon EKS com.amazonaws.region.eks eks
AWS Elastic Beanstalk com.amazonaws.region.elasticbeanstalk elasticbeanstalk
com.amazonaws.region.elasticbeanstalk-health elasticbeanstalk-health
AWS Elastic Disaster Recovery com.amazonaws.region.drs drs
Amazon Elastic File System com.amazonaws.region.elasticfilesystem elasticfilesystem
com.amazonaws.region.elasticfilesystem-fips elasticfilesystem-fips
Amazon Elastic Inference com.amazonaws.region.elastic-inference.runtime elastic-inference.runtime
Elastic Load Balancing com.amazonaws.region.elasticloadbalancing elasticloadbalancing
Amazon ElastiCache com.amazonaws.region.elasticache elasticache
com.amazonaws.region.elasticache-fips elasticache-fips
Amazon EMR com.amazonaws.region.elasticmapreduce elasticmapreduce
Amazon EMR on EKS com.amazonaws.region.emr-containers emr-containers
Amazon EMR Serverless com.amazonaws.region.emr-serverless emr-serverless
Amazon EventBridge com.amazonaws.region.events events
AWS Fault Injection Simulator com.amazonaws.region.fis fis
Amazon FinSpace com.amazonaws.region.finspace finspace
com.amazonaws.region.finspace-api finspace-api
Amazon Forecast com.amazonaws.region.forecast forecast
com.amazonaws.region.forecastquery forecastquery
com.amazonaws.region.forecast-fips forecast-fips
com.amazonaws.region.forecastquery-fips forecastquery-fips
Amazon Fraud Detector com.amazonaws.region.frauddetector frauddetector
Amazon FSx com.amazonaws.region.fsx fsx
com.amazonaws.region.fsx-fips fsx-fips
AWS Glue com.amazonaws.region.glue glue
AWS Glue DataBrew com.amazonaws.region.databrew databrew
Amazon Managed Grafana com.amazonaws.region.grafana grafana
com.amazonaws.region.grafana-workspace grafana-workspace
AWS Ground Station com.amazonaws.region.groundstation groundstation
Amazon HealthLake com.amazonaws.region.healthlake healthlake
IAM Identity Center com.amazonaws.region.identitystore identitystore
IAM Roles Anywhere com.amazonaws.region.rolesanywhere rolesanywhere
Amazon Inspector com.amazonaws.region.inspector2 inspector2
AWS IoT Core com.amazonaws.region.iot.data iot.data
AWS IoT Core Device Advisor com.amazonaws.region.deviceadvisor.iot deviceadvisor.iot
AWS IoT Core for LoRaWAN com.amazonaws.region.iotwireless.api iotwireless.api
com.amazonaws.region.lorawan.cups lorawan.cups
com.amazonaws.region.lorawan.lns lorawan.lns
AWS IoT Greengrass com.amazonaws.region.greengrass greengrass
AWS IoT RoboRunner com.amazonaws.region.iotroborunner iotroborunner
AWS IoT SiteWise com.amazonaws.region.iotsitewise.api iotsitewise.api
com.amazonaws.region.iotsitewise.data iotsitewise.data
AWS IoT TwinMaker com.amazonaws.region.iottwinmaker.api iottwinmaker.api
com.amazonaws.region.iottwinmaker.data iottwinmaker.data
Amazon Kendra com.amazonaws.region.kendra kendra
aws.api.region.kendra-ranking
AWS Key Management Service com.amazonaws.region.kms kms
Amazon Keyspaces (for Apache Cassandra) com.amazonaws.region.cassandra cassandra
com.amazonaws.region.cassandra-fips cassandra-fips
Amazon Kinesis Data Firehose com.amazonaws.region.kinesis-firehose kinesis-firehose
Amazon Kinesis Data Streams com.amazonaws.region.kinesis-streams kinesis-streams
AWS Lake Formation com.amazonaws.region.lakeformation lakeformation
AWS Lambda com.amazonaws.region.lambda lambda
Amazon Lex com.amazonaws.region.models-v2-lex models-v2-lex
com.amazonaws.region.runtime-v2-lex runtime-v2-lex
AWS License Manager com.amazonaws.region.license-manager license-manager
com.amazonaws.region.license-manager-fips license-manager-fips
Amazon Lookout for Equipment com.amazonaws.region.lookoutequipment lookoutequipment
Amazon Lookout for Metrics com.amazonaws.region.lookoutmetrics lookoutmetrics
Amazon Lookout for Vision com.amazonaws.region.lookoutvision lookoutvision
Amazon Macie com.amazonaws.region.macie2 macie2
AWS Mainframe Modernization com.amazonaws.region.m2 m2
Amazon Managed Service for Prometheus com.amazonaws.region.aps aps
com.amazonaws.region.aps-workspaces aps-workspaces
Amazon Managed Workflows for Apache Airflow com.amazonaws.region.airflow.api airflow.api
com.amazonaws.region.airflow.env airflow.env
com.amazonaws.region.airflow.ops airflow.ops
Amazon MemoryDB for Redis com.amazonaws.region.memory-db memory-db
com.amazonaws.region.memorydb-fips memorydb-fips
AWS Migration Hub Orchestrator com.amazonaws.region.migrationhub-orchestrator migrationhub-orchestrator
AWS Migration Hub Refactor Spaces com.amazonaws.region.refactor-spaces refactor-spaces
Migration Hub Strategy Recommendations com.amazonaws.region.migrationhub-strategy migrationhub-strategy
Amazon Nimble Studio com.amazonaws.region.nimble nimble
Amazon Omics com.amazonaws.region.analytics-omics analytics-omics
com.amazonaws.region.control-storage-omics control-storage-omics
com.amazonaws.region.storage-omics storage-omics
com.amazonaws.region.tags-omics tags-omics
com.amazonaws.region.workflows-omics workflows-omics
Amazon OpenSearch Service These endpoints are service-managed
AWS Panorama com.amazonaws.region.panorama panorama
Amazon Pinpoint com.amazonaws.region.pinpoint-sms-voice-v2 pinpoint-sms-voice-v2
Amazon Polly com.amazonaws.region.polly polly
AWS Private 5G com.amazonaws.region.private-networks private-networks
AWS Proton com.amazonaws.region.proton proton
Amazon QLDB com.amazonaws.region.qldb.session qldb.session
Amazon RDS com.amazonaws.region.rds rds
Amazon RDS Data API com.amazonaws.region.rds-data rds-data
Amazon Redshift com.amazonaws.region.redshift redshift
com.amazonaws.region.redshift-fips redshift-fips
Amazon Redshift Data API com.amazonaws.region.redshift-data redshift-data
Amazon Rekognition com.amazonaws.region.rekognition rekognition
com.amazonaws.region.rekognition-fips rekognition-fips
AWS RoboMaker com.amazonaws.region.robomaker robomaker
Amazon S3 com.amazonaws.region.s3 s3
Amazon S3 Multi-Region Access Points com.amazonaws.s3-global.accesspoint
Amazon S3 on Outposts com.amazonaws.region.s3-outposts s3-outposts
Amazon SageMaker aws.sagemaker.region.notebook
aws.sagemaker.region.studio
com.amazonaws.region.sagemaker.api sagemaker.api
com.amazonaws.region.sagemaker.featurestore-runtime sagemaker.featurestore-runtime
com.amazonaws.region.sagemaker.metrics sagemaker.metrics
com.amazonaws.region.sagemaker.runtime sagemaker.runtime
com.amazonaws.region.sagemaker.runtime-fips sagemaker.runtime-fips
AWS Secrets Manager com.amazonaws.region.secretsmanager secretsmanager
AWS Security Hub com.amazonaws.region.securityhub securityhub
AWS Security Token Service com.amazonaws.region.sts sts
AWS Server Migration Service com.amazonaws.region.awsconnector awsconnector
com.amazonaws.region.sms sms
com.amazonaws.region.sms-fips sms-fips
Service Catalog com.amazonaws.region.servicecatalog servicecatalog
com.amazonaws.region.servicecatalog-appregistry servicecatalog-appregistry
Amazon SES com.amazonaws.region.email-smtp email-smtp
AWS Snow Device Management com.amazonaws.region.snow-device-management snow-device-management
Amazon SNS com.amazonaws.region.sns sns
Amazon SQS com.amazonaws.region.sqs sqs
AWS Step Functions com.amazonaws.region.states states
com.amazonaws.region.sync-states sync-states
AWS Storage Gateway com.amazonaws.region.storagegateway storagegateway
AWS Systems Manager com.amazonaws.region.ec2messages ec2messages
com.amazonaws.region.ssm ssm
com.amazonaws.region.ssm-contacts ssm-contacts
com.amazonaws.region.ssm-incidents ssm-incidents
com.amazonaws.region.ssmmessages ssmmessages
Amazon Textract com.amazonaws.region.textract textract
com.amazonaws.region.textract-fips textract-fips
Amazon Transcribe com.amazonaws.region.transcribe transcribe
com.amazonaws.region.transcribestreaming transcribestreaming
Amazon Transcribe Medical com.amazonaws.region.transcribe transcribe
com.amazonaws.region.transcribestreaming transcribestreaming
AWS Transfer for SFTP com.amazonaws.region.transfer transfer
com.amazonaws.region.transfer.server transfer.server
Amazon Translate com.amazonaws.region.translate translate
Amazon WorkSpaces com.amazonaws.region.workspaces workspaces
AWS X-Ray com.amazonaws.region.xray xray