Skip to content

Setting up inbound ingress rules for sagemakers on RDS proxy

0

I want to add full inbound traffic within my VPC so that any sagemaker users in my team can access my RDSproxy.I am using a postgres database with tcp 5432. In the CDK, I have used the code below but its not working.

// Allow all security groups within the VPC to access the RDS Proxy on port 5432
    rdsProxySecurityGroup.addIngressRule(
      Peer.ipv4(vpc.vpcCidrBlock),
      Port.tcp(5432),
      'Allow access from all security groups within the VPC'
    );

Enter image description here

asked 2 years ago318 views
1 Answer
1

Hello.

Looking at the image, the port number set in the security group is MySQL (3306).
Therefore, I think it is possible that the CDK is referencing the wrong security group, or that the security group being checked is wrong.
Is the security group in the image created with CDK's "rdsProxySecurityGroup"?

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
EXPERT
reviewed 2 years ago
  • Thanks for your answer. The picture is a just an example to show where my proxy inbound rules are located. See the code that I added above with port 5432 referencing a postgres database. Its that part that i am trying to adjust.

  • I think there is no problem with the code itself. When you run "cdk deploy", an inbound rule with "5432" will be added to "rdsProxySecurityGroup". https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SecurityGroup.html
    Does "cdk deploy" output any errors? Also, check the CloudFormation stack created by the CDK to see what the security group rules look like.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.