https://pulumi.com logo
#general
Title
# general
w

wooden-hydrogen-21594

07/12/2022, 8:43 PM
Hello everyone 👋 I couldn't find example in TS how to set up Route53 / ALB / ECS / Fargate / RDS in VPC with needed SGs. Could anyone share such example?
c

crooked-laptop-67565

07/12/2022, 9:00 PM
I have mostly got it working by cobbling together the code samples from the Pulumi docs
There's usually an example for each individual thing, which you can copy paste (note though that a number of the TS examples aren't correct and compiler will complain until you fix some error - usually something simple)
For RDS in VPC I did something like this
Copy code
const vpc = new awsx.ec2.Vpc(...);

const dbSubnetGroup = new aws.rds.SubnetGroup("rds", {
  subnetIds: vpc.privateSubnetIds,
})

const securityGroup = new aws.ec2.SecurityGroup("rds", {
  vpcId: vpc.id,
  ingress: [
    {
      fromPort: 5432,
      toPort: 5432,
      protocol: "tcp",
      description: "Postgres",
      cidrBlocks: [vpc.vpc.cidrBlock],
    },
  ],
});
const postgres = new aws.rds.Instance("postgresdb", {
  //...
  dbSubnetGroupName: dbSubnetGroup.name  vpcSecurityGroupIds: [securityGroup.id],
});
w

witty-candle-66007

07/12/2022, 10:41 PM
It's python but should be pretty easy to “translate”
2 Views