Unable to create Inbound rule

0

I'm using powershell to create inbound IP rules for an EC2 Instance sec group. I'm running the following code. $IpRange = New-Object -TypeName Amazon.EC2.Model.IpRange $IpRange.CidrIp = "<IPAddr>/32" $IpRange.Description = "Sean" $IpPermission = New-Object Amazon.EC2.Model.IpPermission $IpPermission.IpProtocol = "tcp" $IpPermission.ToPort = 3389 $IpPermission.FromPort = 3389 $IpPermission.Ipv4Ranges = $IpRange Grant-EC2SecurityGroupIngress -GroupId sg-00xxxx -IpPermission $IpPermission

It seems to work just fine at the cmdline, but nothing gets pushed to AWS. Is there something else I need to do?

gefragt vor 2 Jahren266 Aufrufe
1 Antwort
0

Hi,

Use the below link for guidance to setup your security group using powershell[1]https://docs.aws.amazon.com/powershell/latest/userguide/pstools-ec2-sg.html

When viewing the security group please make sure you are in the correct region, consider using DescribeSecurityGroups API call to view your security group if it was created succesfullly[1]https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html

secondly you can use cloudtrail to check the api call when you create a security group[2]https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSecurityGroup.html

And if you are using Powershell you need to have AWS powershell tools installed[3]https://aws.amazon.com/powershell/

you can also try using Systems Manager Run Command AWS-RunPowerShellScript document[4]https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen