EMR / Client / put_block_public_access_configuration
put_block_public_access_configuration#
- EMR.Client.put_block_public_access_configuration(**kwargs)#
Creates or updates an Amazon EMR block public access configuration for your Amazon Web Services 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
response = client.put_block_public_access_configuration( BlockPublicAccessConfiguration={ 'BlockPublicSecurityGroupRules': True|False, 'PermittedPublicSecurityGroupRuleRanges': [ { 'MinRange': 123, 'MaxRange': 123 }, ] } )
- Parameters:
BlockPublicAccessConfiguration (dict) –
[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 theBlockPublicAccessConfiguration
. By default, Port 22 (SSH) is an exception, and public access is allowed on this port. You can change this by updatingBlockPublicSecurityGroupRules
to remove the exception.Note
For accounts that created clusters in a Region before November 25, 2019, block public access is disabled by default in that Region. To use this feature, you must manually enable and configure it. For accounts that did not create an Amazon EMR cluster in a Region before this date, block public access is enabled by default in that Region.
BlockPublicSecurityGroupRules (boolean) – [REQUIRED]
Indicates whether Amazon EMR block public access is enabled (
true
) or disabled (false
). By default, the value isfalse
for accounts that have created Amazon EMR clusters before July 2019. For accounts created after this, the default istrue
.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 Amazon 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
andMaxRange
.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.
- Return type:
dict
- Returns:
Response Syntax
{}
Response Structure
(dict) –
Exceptions