Closed Yusadolat closed 2 years ago
Yes, this should be possible when you provide a VPC. For instance, if you want to replace NAT Gateway with NAT Instances, you can do this:
const vpc = new ec2.Vpc(this, 'Vpc', {
// This replaces the nat gateway with nat instances.
natGatewayProvider: ec2.NatInstanceProvider.instance({
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO),
}),
subnetConfiguration: [
{
name: 'public',
subnetType: ec2.SubnetType.PUBLIC,
},
{
name: 'private',
subnetType: ec2.SubnetType.PRIVATE_WITH_NAT,
},
],
});
new keycloak.KeycloakCluster(this, 'Keycloak', {
// Provide an existing VPC so the cluster and database can reuse it
vpcProvider: keycloak.VpcProvider.fromVpc(vpc),
});
Please let me know whether this will work for you.
Thanks for the response. I'm actually looking a way not use use NAT Gateway at all. I want to have public IPs for my ECS and Database.
Thanks for the response. I'm actually looking a way not use use NAT Gateway at all. I want to have public IPs for my ECS and Database.
Gotcha. Perhaps something like this:
const vpc = new ec2.Vpc(this, 'Vpc', {
subnetConfiguration: [
{
name: 'public',
subnetType: ec2.SubnetType.PUBLIC,
},
],
});
new keycloak.KeycloakCluster(this, 'Keycloak', {
vpcProvider: keycloak.VpcProvider.fromVpc(vpc),
vpcTaskAssignPublicIp: true,
vpcTaskSubnets: {
subnetType: ec2.SubnetType.PUBLIC,
},
});
Yeah, Thanks so much for your time.
Hi there, Thanks for putting this together. Is there a way to remove NAT Gateway from the provision instance. NAT Gateway seems too pricey.