NetworkSecurityManagerCustomerAPI / Client / update_policy
update_policy¶
- NetworkSecurityManagerCustomerAPI.Client.update_policy(**kwargs)¶
Updates the specified policy. To prevent conflicting concurrent updates, provide the current
updateToken. UseisPublishedto publish the update or keep the policy as a draft.See also: AWS API Documentation
Request Syntax
response = client.update_policy( policyIdentifier='string', updateToken='string', policyDescription='string', priority=123, associatedTemplateAndRuleList=[ { 'templateIdentifier': 'string', 'ruleIdentifier': 'string' }, ], policyConfiguration={ 'remediationEnabled': True|False, 'resourcesCleanUp': True|False, 'wafConfig': { 'existingCustomerWebACLResolution': 'RETROFIT'|'OVERRIDE_ASSOCIATION'|'NO_REMEDIATION', 'conflictResolution': 'MERGE_WHERE_APPLICABLE' } }, isPublished=True|False, clientToken='string' )
- Parameters:
policyIdentifier (string) –
[REQUIRED]
The identifier of the policy. This is the policy’s Amazon Resource Name (ARN).
updateToken (string) –
[REQUIRED]
A token used for optimistic concurrency control. Each read and write returns an
updateToken. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.policyDescription (string) – A description of the policy.
priority (integer) – The priority of the resource. A lower number indicates a higher priority.
associatedTemplateAndRuleList (list) –
The templates and rules to associate with the policy. For AWS WAF policies, specify 1 to 100 templates or rules, of which at most 2 can be templates. For AWS Shield Advanced policies, this list must be empty.
(dict) –
A reference to either a template or a rule in a create or update request. Set exactly one of
templateIdentifierorruleIdentifier.Note
This is a Tagged Union structure. Only one of the following top level keys can be set:
templateIdentifier,ruleIdentifier.templateIdentifier (string) –
The identifier of the template. This is the template’s Amazon Resource Name (ARN).
ruleIdentifier (string) –
The identifier of the rule. This is the rule’s Amazon Resource Name (ARN).
policyConfiguration (dict) –
The configuration settings that control the policy’s behavior, including remediation and firewall-type-specific settings.
remediationEnabled (boolean) – [REQUIRED]
Specifies whether AWS Network Security Manager automatically remediates noncompliant resources. Default:
false.resourcesCleanUp (boolean) – [REQUIRED]
Specifies whether AWS Network Security Manager automatically removes the resources it created when they are no longer needed. Default:
false.wafConfig (dict) –
AWS WAF-specific policy settings. This is populated only for AWS WAF policies.
existingCustomerWebACLResolution (string) – [REQUIRED]
Determines how AWS Network Security Manager handles remediation when a resource already has a customer-created web ACL. Required for AWS WAF policies.
conflictResolution (string) – [REQUIRED]
The conflict-resolution strategy for AWS WAF policies. Required for AWS WAF policies.
isPublished (boolean) –
[REQUIRED]
Specifies whether to publish the resource. When
true, the resource is saved in published (ACTIVE) state. Whenfalse, it is saved as a draft (DRAFT).clientToken (string) –
A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.
This field is autopopulated if not provided.
- Return type:
dict
- Returns:
Response Syntax
{ 'policyId': 'string', 'policyArn': 'string', 'policyName': 'string', 'policyDescription': 'string', 'status': 'DRAFT'|'ACTIVE'|'DISABLED', 'priority': 123, 'associatedTemplateAndRuleList': [ { 'templateArn': 'string', 'ruleArn': 'string' }, ], 'version': 'string', 'updateToken': 'string', 'isSnapshot': True|False, 'hasPublishedVersion': True|False, 'firewallType': 'WAF'|'SHIELD_ADVANCED', 'policyConfiguration': { 'remediationEnabled': True|False, 'resourcesCleanUp': True|False, 'wafConfig': { 'existingCustomerWebACLResolution': 'RETROFIT'|'OVERRIDE_ASSOCIATION'|'NO_REMEDIATION', 'conflictResolution': 'MERGE_WHERE_APPLICABLE' } }, 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) –
policyId (string) –
The service-generated id of the policy.
policyArn (string) –
The Amazon Resource Name (ARN) of the policy.
policyName (string) –
The name of the policy.
policyDescription (string) –
A description of the policy.
status (string) –
The current status of the resource:
DRAFT(unpublished, editable) orACTIVE(published, in use).priority (integer) –
The priority of the resource. A lower number indicates a higher priority.
associatedTemplateAndRuleList (list) –
The templates and rules associated with the policy. For AWS WAF policies, this list contains 1 to 100 templates or rules, of which at most 2 can be templates. For AWS Shield Advanced policies, this list is empty.
(dict) –
An association between a policy and either a template or a rule, as returned in outputs. Exactly one of
templateArnorruleArnis set. The corresponding request structure isTemplateOrRuleReference.Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
templateArn,ruleArn. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
templateArn (string) –
The ARN of the associated template.
ruleArn (string) –
The ARN of the associated rule.
version (string) –
The version of the resource.
updateToken (string) –
A token used for optimistic concurrency control. Each read and write returns an
updateToken. Provide the most recent value on your next update to detect and prevent conflicting concurrent modifications.isSnapshot (boolean) –
Specifies whether the resource is a snapshot of a published version.
hasPublishedVersion (boolean) –
Specifies whether a published version of the resource exists.
firewallType (string) –
The firewall type associated with the resource.
policyConfiguration (dict) –
The configuration settings that control the policy’s behavior, including remediation and firewall-type-specific settings.
remediationEnabled (boolean) –
Specifies whether AWS Network Security Manager automatically remediates noncompliant resources. Default:
false.resourcesCleanUp (boolean) –
Specifies whether AWS Network Security Manager automatically removes the resources it created when they are no longer needed. Default:
false.wafConfig (dict) –
AWS WAF-specific policy settings. This is populated only for AWS WAF policies.
existingCustomerWebACLResolution (string) –
Determines how AWS Network Security Manager handles remediation when a resource already has a customer-created web ACL. Required for AWS WAF policies.
conflictResolution (string) –
The conflict-resolution strategy for AWS WAF policies. Required for AWS WAF policies.
updatedAt (datetime) –
The time when the resource was last updated.
Exceptions
NetworkSecurityManagerCustomerAPI.Client.exceptions.ValidationExceptionNetworkSecurityManagerCustomerAPI.Client.exceptions.ServiceQuotaExceededExceptionNetworkSecurityManagerCustomerAPI.Client.exceptions.ConflictExceptionNetworkSecurityManagerCustomerAPI.Client.exceptions.InternalServerExceptionNetworkSecurityManagerCustomerAPI.Client.exceptions.AccessDeniedExceptionNetworkSecurityManagerCustomerAPI.Client.exceptions.ResourceNotFoundExceptionNetworkSecurityManagerCustomerAPI.Client.exceptions.ThrottlingException