Amazon Elastic MapReduce

2019/08/16 - Amazon Elastic MapReduce - 2 new api methods

Changes  Amazon EMR has introduced an account level configuration called Block Public Access that allows you to block clusters with ports open to traffic from public IP sources (i.e. 0.0.0.0/0 for IPv4 and ::/0 for IPv6) from launching. Individual ports or port ranges can be added as exceptions to allow public access.

GetBlockPublicAccessConfiguration (new) Link ¶

Returns the Amazon EMR block public access configuration for your AWS account in the current Region. For more information see Configure Block Public Access for Amazon EMR in the Amazon EMR Management Guide .

See also: AWS API Documentation

Request Syntax

client.get_block_public_access_configuration()
rtype

dict

returns

Response Syntax

{
    'BlockPublicAccessConfiguration': {
        'BlockPublicSecurityGroupRules': True|False,
        'PermittedPublicSecurityGroupRuleRanges': [
            {
                'MinRange': 123,
                'MaxRange': 123
            },
        ]
    },
    'BlockPublicAccessConfigurationMetadata': {
        'CreationDateTime': datetime(2015, 1, 1),
        'CreatedByArn': 'string'
    }
}

Response Structure

  • (dict) --

    • BlockPublicAccessConfiguration (dict) --

      A configuration for Amazon EMR block public access. The configuration applies to all clusters created in your account for the current Region. The configuration specifies whether block public access is enabled. If block public access is enabled, security groups associated with the cluster cannot have rules that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges in the BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updating the block public access configuration to remove the exception.

      • BlockPublicSecurityGroupRules (boolean) --

        Indicates whether EMR block public access is enabled (true ) or disabled (false ). By default, the value is false for accounts that have created EMR clusters before July 2019. For accounts created after this, the default is true .

      • PermittedPublicSecurityGroupRuleRanges (list) --

        Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from all public sources. For example, if Port 23 (Telnet) is specified for PermittedPublicSecurityGroupRuleRanges , Amazon EMR allows cluster creation if a security group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port ::/0 as the source.

        By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of PermittedPublicSecurityGroupRuleRanges .

        • (dict) --

          A list of port ranges that are permitted to allow inbound traffic from all public IP addresses. To specify a single port, use the same value for MinRange and MaxRange .

          • MinRange (integer) --

            The smallest port number in a specified range of port numbers.

          • MaxRange (integer) --

            The smallest port number in a specified range of port numbers.

    • BlockPublicAccessConfigurationMetadata (dict) --

      Properties that describe the AWS principal that created the BlockPublicAccessConfiguration using the PutBlockPublicAccessConfiguration action as well as the date and time that the configuration was created. Each time a configuration for block public access is updated, Amazon EMR updates this metadata.

      • CreationDateTime (datetime) --

        The date and time that the configuration was created.

      • CreatedByArn (string) --

        The Amazon Resource Name that created or last modified the configuration.

PutBlockPublicAccessConfiguration (new) Link ¶

Creates or updates an Amazon EMR block public access configuration for your AWS account in the current Region. For more information see Configure Block Public Access for Amazon EMR in the Amazon EMR Management Guide .

See also: AWS API Documentation

Request Syntax

client.put_block_public_access_configuration(
    BlockPublicAccessConfiguration={
        'BlockPublicSecurityGroupRules': True|False,
        'PermittedPublicSecurityGroupRuleRanges': [
            {
                'MinRange': 123,
                'MaxRange': 123
            },
        ]
    }
)
type BlockPublicAccessConfiguration

dict

param BlockPublicAccessConfiguration

[REQUIRED]

A configuration for Amazon EMR block public access. The configuration applies to all clusters created in your account for the current Region. The configuration specifies whether block public access is enabled. If block public access is enabled, security groups associated with the cluster cannot have rules that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an exception using PermittedPublicSecurityGroupRuleRanges in the BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updating BlockPublicSecurityGroupRules to remove the exception.

  • BlockPublicSecurityGroupRules (boolean) -- [REQUIRED]

    Indicates whether EMR block public access is enabled (true ) or disabled (false ). By default, the value is false for accounts that have created EMR clusters before July 2019. For accounts created after this, the default is true .

  • PermittedPublicSecurityGroupRuleRanges (list) --

    Specifies ports and port ranges that are permitted to have security group rules that allow inbound traffic from all public sources. For example, if Port 23 (Telnet) is specified for PermittedPublicSecurityGroupRuleRanges , Amazon EMR allows cluster creation if a security group associated with the cluster has a rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port ::/0 as the source.

    By default, Port 22, which is used for SSH access to the cluster EC2 instances, is in the list of PermittedPublicSecurityGroupRuleRanges .

    • (dict) --

      A list of port ranges that are permitted to allow inbound traffic from all public IP addresses. To specify a single port, use the same value for MinRange and MaxRange .

      • MinRange (integer) -- [REQUIRED]

        The smallest port number in a specified range of port numbers.

      • MaxRange (integer) --

        The smallest port number in a specified range of port numbers.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --