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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠