PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Revoking Access

Example 767. Revoke by IP

revokeIp Revokes permissions to a security group based on an IP address, protocol type and port range. The permissions used to revoke must be specified using the same values used to grant the permissions.

Permissions are specified by the IP protocol (TCP, UDP or ICMP), the source of the request (by IP range or an Amazon EC2 user-group pair), the source and destination port ranges (for TCP and UDP), and the ICMP codes and types (for ICMP). When authorizing ICMP, -1 can be used as a wildcard in the type and code fields.

Permission changes are propagated to instances within the security group as quickly as possible. However, depending on the number of instances, a small delay might occur.

revokeIp returns boolean TRUE or FALSE

<?php
$ec2_sg 
= new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
                                                     
'aws_secret_key');
$return $ec2_sg->revokeIp('mygroup',
                             
'protocol',
                             
'fromPort',
                             
'toPort',
                             
'ipRange');

Example 768. Revoke By Group

revokeGroup Adds permissions to a security group. The permissions to revoke must be specified using the same values used to grant the permissions.

Permission changes are propagated to instances within the security group as quickly as possible. However, depending on the number of instances, a small delay might occur.

revokeGroup returns boolean TRUE or FALSE.

<?php
$ec2_sg 
= new Zend_Service_Amazon_Ec2_Securitygroups('aws_key',
                                                     
'aws_secret_key');
$return $ec2_sg->revokeGroup('mygroup''securityGroupName''ownerId');

Zend Framework