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?

已提问 2 年前266 查看次数
1 回答
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

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则