so arbeite ich an Skript, das Port 22
auf 0.0.0.0/0 and ::/0
, jetzt unter Skript löscht funktioniert gut auf Standard-VPC aber wenn ich VPC es gibt ungültige Berechtigung ändern nicht gefunden Fehler. Ich bin nicht in der Lage zu verstehen, warum seine geben errrr in einem anderen VPC aber in Standard adaequat VPCUpdating Sicherheitsgruppe in einem anderen VPC wirft Fehler von InvalidPermission.NotFound
def update_port(fromport, toport, groupid, vpcid):
response = client.revoke_security_group_ingress(
GroupId=groupid,
IpPermissions=[
{
'FromPort': fromport,
'IpProtocol': 'tcp',
'IpRanges': [
{
'CidrIp': '0.0.0.0/0'
},
],
'Ipv6Ranges': [
{
'CidrIpv6': '::/0'
},
],
'ToPort': toport,
'UserIdGroupPairs': [
{
'GroupId': groupid,
'VpcId': vpcid,
},
],
},
],
)
Ausführung:
update_port(22,22,'sg-groupid','vpc-vpcid')
Fehler:
botocore.exceptions.ClientError: An error occurred (InvalidPermission.NotFound) when calling the RevokeSecurityGroupIngress operation: The specified rule does not exist in this security group.
Regel vorhanden, wenn Sie meine Frage richtig lesen können Ich erklärte, dass die Funktion funktioniert perfekt auf Standard-VPC aber Problem kommt in einem anderen VPC sg. –