Questions tagged [aws-security-group]

Amazon EC2 Security Groups

Amazon EC2 Security Groups for EC2. A security group acts as a virtual firewall that controls the traffic for one or more instances. When you launch an instance, you associate one or more security groups with the instance.

See Amazon EC2 Security Groups

820 questions
8
votes
5 answers

Updating Existing IPs from a Security Group in AWS using aws cli

I have a shell script which adds my public ip to the specified ec2-security-group. I've gone through some AWS docs and can't find which Apis to use to update existing IP address instead of simply adding one. I've gone through the…
8
votes
2 answers

Cloudformation Security Group configuration using list

I am defining a cloudformation stack where the security group should allow ingress traffic from specified IP addresses. I have defined these IP addresses as mapping and they will grow in future when we onboard new customers on our platform. My…
kk.
  • 3,747
  • 12
  • 36
  • 67
8
votes
3 answers

Is there a way to have AWS RDS Public Accessibility = No but still accessible outside of EC2 instance?

For management-related reasons, I need the Public Accessibility option set to "No" for the RDS. However, we're also looking into being able to access the RDS from our local devices. The only way we're able to do so is by selecting "Yes" in Public…
8
votes
1 answer

Use of Security Groups vs Role

I have a AWS lambda that is created to access an RDS postgresql instance and an elasticcache cluster. In order to access the RDS instance , I believe both RDS and Elasticache need to open up then inbound ports for the lambda to access. I have also…
8
votes
2 answers

How to add a security group to an existing EC2 instance with CloudFormation

Currently, our AWS infrastructure has many instances which are attached to security groups, which I created in the console. We are re-structuring our security groups with CloudFormation, thus we can have a comment and description in each rule. My…
7
votes
2 answers

How to add a Fargate Service to Inbound Security Rules?

I have a Fargate Service running in AWS. I use it to run multiple tasks. Some of the tasks connect to an RDS database to query the database. How can I add the Fargate Service to my inboard rules of a Security Group for the RDS database? - Is…
fuzzi
  • 1,967
  • 9
  • 46
  • 90
7
votes
2 answers

AWS Cloudformation: Security Group Rule to allow all egress

I am using the following egress rule in a security group definition of a cloudformation template SecurityGroupEgress: - IpProtocol: tcp FromPort: 0 ToPort: 65535 CidrIp: 0.0.0.0/0 However this does not end up in a rule that allow…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
7
votes
5 answers

How can I get the the ID of an AWS security group if I know the name?

I'm using the AWS CLI and I want to get the ID of security group whose name I know (kingkajou_sg). How can I do it? When I ask it to list all the security groups, it does so happily: $ aws ec2 describe-security-groups | wc -l 430 When I grep…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
7
votes
7 answers

CLI command "describe-instances" throw error "An error occurred (AuthFailure) when calling the

I was able to install CLI on windows 16 AWS instance. when I try "aws ec2 describe-instances" CLI command, I get the following error CLI command "describe-instances" throw error "An error occurred (AuthFailure) when calling the DescribeInstances…
7
votes
1 answer

Changes to inbound rules are not updating to instance

In the AWS management console I have a single instance. When I go to that instance's description and click view inbound rules I get: 80 tcp 0.0.0.0/0 ✔ 22 tcp 24.47.137.69/32 ✔ 443 tcp 0.0.0.0/0 ✔ If I go to that instance's security…
shoe
  • 952
  • 1
  • 20
  • 44
7
votes
4 answers

Security group for AWS NTP Server

I just try to synchronize time with NTP-Server on EC2 instances: server 0.amazon.pool.ntp.org iburst server 1.amazon.pool.ntp.org iburst server 2.amazon.pool.ntp.org iburst server 3.amazon.pool.ntp.org iburst Unfortunately, I couldn't sync…
Toan Dao
  • 551
  • 7
  • 19
7
votes
1 answer

How to add multiple security groups and group names in cloudformation using template?

"dbxSG": { "Type": "AWS::EC2::SecurityGroup", "Properties": { "GroupDescription": "Enable dbX Access", "SecurityGroupIngress": [ { "IpProtocol": "tcp", "FromPort": "22", …
shas
  • 703
  • 2
  • 8
  • 31
6
votes
2 answers

Terraform - Use security group ID created in separate file for EC2 instance creation

I have used this module to create a security group in AWS VPC. How do I reference the resource created from this in a separate file? I am creating our bastion instance in a separate directory in the same repo. My bastion config looks like the…
6
votes
1 answer

Error creating Security Group: InvalidGroup.Duplicate when defining AWS security group in Terraform

I'm new to Terraform, when I run Terraform apply, I git this error: Error: Error creating Security Group: InvalidGroup.Duplicate: The security group 'xxxxxxx' already exists for VPC 'vpc-xxxxxx' status code: 400 The script for this part…
6
votes
2 answers

CloudFormation SecurityGroup Circular Reference

I am working with two simple web apps that need to talk to each other. Within AWS CloudFormation I have a template that creates an EC2 instance and installs both applications on the same server (eventually I'll split them up, but for now they live…
1 2
3
54 55