Skip to content
GitHubXDiscordRSS

ResourceGateway

Learn how to create, update, and manage AWS VpcLattice ResourceGateways using Alchemy Cloud Control.

The ResourceGateway resource allows you to manage AWS VpcLattice ResourceGateways which connect your VPCs and resources through a unified gateway interface.

This example demonstrates how to create a basic ResourceGateway with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const basicResourceGateway = await AWS.VpcLattice.ResourceGateway("basicResourceGateway", {
name: "my-resource-gateway",
vpcIdentifier: "vpc-12345678",
subnetIds: [
"subnet-87654321",
"subnet-12345678"
],
ipAddressType: "ipv4" // Optional
});

This example shows how to configure a ResourceGateway with additional settings such as security groups and tags for better management and identification.

const advancedResourceGateway = await AWS.VpcLattice.ResourceGateway("advancedResourceGateway", {
name: "advanced-resource-gateway",
vpcIdentifier: "vpc-12345678",
subnetIds: [
"subnet-87654321",
"subnet-12345678"
],
securityGroupIds: [
"sg-12345678",
"sg-87654321"
],
tags: [
{ key: "Environment", value: "Production" },
{ key: "Project", value: "MyProject" }
]
});

This example demonstrates how to adopt an existing ResourceGateway instead of failing if the resource already exists.

const adoptedResourceGateway = await AWS.VpcLattice.ResourceGateway("adoptedResourceGateway", {
name: "existing-resource-gateway",
vpcIdentifier: "vpc-12345678",
subnetIds: [
"subnet-87654321",
"subnet-12345678"
],
adopt: true // This enables the adoption of existing resources
});

Here’s how to configure a ResourceGateway with specific security group settings to control inbound and outbound traffic.

const securedResourceGateway = await AWS.VpcLattice.ResourceGateway("securedResourceGateway", {
name: "secured-resource-gateway",
vpcIdentifier: "vpc-12345678",
subnetIds: [
"subnet-87654321",
"subnet-12345678"
],
securityGroupIds: [
"sg-12345678"
],
ipAddressType: "ipv4"
});