Interface Policy.Builder
-
- All Superinterfaces:
Buildable,CopyableBuilder<Policy.Builder,Policy>,SdkBuilder<Policy.Builder,Policy>,SdkPojo
- Enclosing class:
- Policy
public static interface Policy.Builder extends SdkPojo, CopyableBuilder<Policy.Builder,Policy>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Policy.BuilderdeleteUnusedFMManagedResources(Boolean deleteUnusedFMManagedResources)Indicates whether Firewall Manager should automatically remove protections from resources that leave the policy scope and clean up resources that Firewall Manager is managing for accounts when those accounts leave policy scope.Policy.BuilderexcludeMap(Map<CustomerPolicyScopeIdType,? extends Collection<String>> excludeMap)Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy.Policy.BuilderexcludeMapWithStrings(Map<String,? extends Collection<String>> excludeMap)Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy.Policy.BuilderexcludeResourceTags(Boolean excludeResourceTags)If set toTrue, resources with the tags that are specified in theResourceTagarray are not in scope of the policy.Policy.BuilderincludeMap(Map<CustomerPolicyScopeIdType,? extends Collection<String>> includeMap)Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy.Policy.BuilderincludeMapWithStrings(Map<String,? extends Collection<String>> includeMap)Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy.Policy.BuilderpolicyDescription(String policyDescription)Your description of the Firewall Manager policy.Policy.BuilderpolicyId(String policyId)The ID of the Firewall Manager policy.Policy.BuilderpolicyName(String policyName)The name of the Firewall Manager policy.Policy.BuilderpolicyStatus(String policyStatus)Indicates whether the policy is in or out of an admin's policy or Region scope.Policy.BuilderpolicyStatus(CustomerPolicyStatus policyStatus)Indicates whether the policy is in or out of an admin's policy or Region scope.Policy.BuilderpolicyUpdateToken(String policyUpdateToken)A unique identifier for each update to the policy.Policy.BuilderremediationEnabled(Boolean remediationEnabled)Indicates if the policy should be automatically applied to new resources.Policy.BuilderresourceSetIds(String... resourceSetIds)The unique identifiers of the resource sets used by the policy.Policy.BuilderresourceSetIds(Collection<String> resourceSetIds)The unique identifiers of the resource sets used by the policy.Policy.BuilderresourceTags(Collection<ResourceTag> resourceTags)An array ofResourceTagobjects.Policy.BuilderresourceTags(Consumer<ResourceTag.Builder>... resourceTags)An array ofResourceTagobjects.Policy.BuilderresourceTags(ResourceTag... resourceTags)An array ofResourceTagobjects.Policy.BuilderresourceType(String resourceType)The type of resource protected by or in scope of the policy.Policy.BuilderresourceTypeList(String... resourceTypeList)An array ofResourceTypeobjects.Policy.BuilderresourceTypeList(Collection<String> resourceTypeList)An array ofResourceTypeobjects.default Policy.BuildersecurityServicePolicyData(Consumer<SecurityServicePolicyData.Builder> securityServicePolicyData)Details about the security service that is being used to protect the resources.Policy.BuildersecurityServicePolicyData(SecurityServicePolicyData securityServicePolicyData)Details about the security service that is being used to protect the resources.-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
-
-
-
Method Detail
-
policyId
Policy.Builder policyId(String policyId)
The ID of the Firewall Manager policy.
- Parameters:
policyId- The ID of the Firewall Manager policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
policyName
Policy.Builder policyName(String policyName)
The name of the Firewall Manager policy.
- Parameters:
policyName- The name of the Firewall Manager policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
policyUpdateToken
Policy.Builder policyUpdateToken(String policyUpdateToken)
A unique identifier for each update to the policy. When issuing a
PutPolicyrequest, thePolicyUpdateTokenin the request must match thePolicyUpdateTokenof the current policy version. To get thePolicyUpdateTokenof the current policy version, use aGetPolicyrequest.- Parameters:
policyUpdateToken- A unique identifier for each update to the policy. When issuing aPutPolicyrequest, thePolicyUpdateTokenin the request must match thePolicyUpdateTokenof the current policy version. To get thePolicyUpdateTokenof the current policy version, use aGetPolicyrequest.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
securityServicePolicyData
Policy.Builder securityServicePolicyData(SecurityServicePolicyData securityServicePolicyData)
Details about the security service that is being used to protect the resources.
- Parameters:
securityServicePolicyData- Details about the security service that is being used to protect the resources.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
securityServicePolicyData
default Policy.Builder securityServicePolicyData(Consumer<SecurityServicePolicyData.Builder> securityServicePolicyData)
Details about the security service that is being used to protect the resources.
This is a convenience method that creates an instance of theSecurityServicePolicyData.Builderavoiding the need to create one manually viaSecurityServicePolicyData.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed tosecurityServicePolicyData(SecurityServicePolicyData).- Parameters:
securityServicePolicyData- a consumer that will call methods onSecurityServicePolicyData.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
securityServicePolicyData(SecurityServicePolicyData)
-
resourceType
Policy.Builder resourceType(String resourceType)
The type of resource protected by or in scope of the policy. This is in the format shown in the Amazon Web Services Resource Types Reference. To apply this policy to multiple resource types, specify a resource type of
ResourceTypeListand then specify the resource types in aResourceTypeList.The following are valid resource types for each Firewall Manager policy type:
-
Amazon Web Services WAF Classic -
AWS::ApiGateway::Stage,AWS::CloudFront::Distribution, andAWS::ElasticLoadBalancingV2::LoadBalancer. -
WAF -
AWS::ApiGateway::Stage,AWS::ElasticLoadBalancingV2::LoadBalancer, andAWS::CloudFront::Distribution. -
Shield Advanced -
AWS::ElasticLoadBalancingV2::LoadBalancer,AWS::ElasticLoadBalancing::LoadBalancer,AWS::EC2::EIP, andAWS::CloudFront::Distribution. -
Network ACL -
AWS::EC2::Subnet. -
Security group usage audit -
AWS::EC2::SecurityGroup. -
Security group content audit -
AWS::EC2::SecurityGroup,AWS::EC2::NetworkInterface, andAWS::EC2::Instance. -
DNS Firewall, Network Firewall, and third-party firewall -
AWS::EC2::VPC.
- Parameters:
resourceType- The type of resource protected by or in scope of the policy. This is in the format shown in the Amazon Web Services Resource Types Reference. To apply this policy to multiple resource types, specify a resource type ofResourceTypeListand then specify the resource types in aResourceTypeList.The following are valid resource types for each Firewall Manager policy type:
-
Amazon Web Services WAF Classic -
AWS::ApiGateway::Stage,AWS::CloudFront::Distribution, andAWS::ElasticLoadBalancingV2::LoadBalancer. -
WAF -
AWS::ApiGateway::Stage,AWS::ElasticLoadBalancingV2::LoadBalancer, andAWS::CloudFront::Distribution. -
Shield Advanced -
AWS::ElasticLoadBalancingV2::LoadBalancer,AWS::ElasticLoadBalancing::LoadBalancer,AWS::EC2::EIP, andAWS::CloudFront::Distribution. -
Network ACL -
AWS::EC2::Subnet. -
Security group usage audit -
AWS::EC2::SecurityGroup. -
Security group content audit -
AWS::EC2::SecurityGroup,AWS::EC2::NetworkInterface, andAWS::EC2::Instance. -
DNS Firewall, Network Firewall, and third-party firewall -
AWS::EC2::VPC.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
resourceTypeList
Policy.Builder resourceTypeList(Collection<String> resourceTypeList)
An array of
ResourceTypeobjects. Use this only to specify multiple resource types. To specify a single resource type, useResourceType.- Parameters:
resourceTypeList- An array ofResourceTypeobjects. Use this only to specify multiple resource types. To specify a single resource type, useResourceType.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
resourceTypeList
Policy.Builder resourceTypeList(String... resourceTypeList)
An array of
ResourceTypeobjects. Use this only to specify multiple resource types. To specify a single resource type, useResourceType.- Parameters:
resourceTypeList- An array ofResourceTypeobjects. Use this only to specify multiple resource types. To specify a single resource type, useResourceType.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
resourceTags
Policy.Builder resourceTags(Collection<ResourceTag> resourceTags)
An array of
ResourceTagobjects.- Parameters:
resourceTags- An array ofResourceTagobjects.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
resourceTags
Policy.Builder resourceTags(ResourceTag... resourceTags)
An array of
ResourceTagobjects.- Parameters:
resourceTags- An array ofResourceTagobjects.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
resourceTags
Policy.Builder resourceTags(Consumer<ResourceTag.Builder>... resourceTags)
An array of
This is a convenience method that creates an instance of theResourceTagobjects.ResourceTag.Builderavoiding the need to create one manually viaResourceTag.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed to#resourceTags(List.) - Parameters:
resourceTags- a consumer that will call methods onResourceTag.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#resourceTags(java.util.Collection)
-
excludeResourceTags
Policy.Builder excludeResourceTags(Boolean excludeResourceTags)
If set to
True, resources with the tags that are specified in theResourceTagarray are not in scope of the policy. If set toFalse, and theResourceTagarray is not null, only resources with the specified tags are in scope of the policy.- Parameters:
excludeResourceTags- If set toTrue, resources with the tags that are specified in theResourceTagarray are not in scope of the policy. If set toFalse, and theResourceTagarray is not null, only resources with the specified tags are in scope of the policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
remediationEnabled
Policy.Builder remediationEnabled(Boolean remediationEnabled)
Indicates if the policy should be automatically applied to new resources.
- Parameters:
remediationEnabled- Indicates if the policy should be automatically applied to new resources.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
deleteUnusedFMManagedResources
Policy.Builder deleteUnusedFMManagedResources(Boolean deleteUnusedFMManagedResources)
Indicates whether Firewall Manager should automatically remove protections from resources that leave the policy scope and clean up resources that Firewall Manager is managing for accounts when those accounts leave policy scope. For example, Firewall Manager will disassociate a Firewall Manager managed web ACL from a protected customer resource when the customer resource leaves policy scope.
By default, Firewall Manager doesn't remove protections or delete Firewall Manager managed resources.
This option is not available for Shield Advanced or WAF Classic policies.
- Parameters:
deleteUnusedFMManagedResources- Indicates whether Firewall Manager should automatically remove protections from resources that leave the policy scope and clean up resources that Firewall Manager is managing for accounts when those accounts leave policy scope. For example, Firewall Manager will disassociate a Firewall Manager managed web ACL from a protected customer resource when the customer resource leaves policy scope.By default, Firewall Manager doesn't remove protections or delete Firewall Manager managed resources.
This option is not available for Shield Advanced or WAF Classic policies.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
includeMapWithStrings
Policy.Builder includeMapWithStrings(Map<String,? extends Collection<String>> includeMap)
Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.
You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
- Parameters:
includeMap- Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
includeMap
Policy.Builder includeMap(Map<CustomerPolicyScopeIdType,? extends Collection<String>> includeMap)
Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.
You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
- Parameters:
includeMap- Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
excludeMapWithStrings
Policy.Builder excludeMapWithStrings(Map<String,? extends Collection<String>> excludeMap)
Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.
You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
- Parameters:
excludeMap- Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
excludeMap
Policy.Builder excludeMap(Map<CustomerPolicyScopeIdType,? extends Collection<String>> excludeMap)
Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.
You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
- Parameters:
excludeMap- Specifies the Amazon Web Services account IDs and Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.You can specify inclusions or exclusions, but not both. If you specify an
IncludeMap, Firewall Manager applies the policy to all accounts specified by theIncludeMap, and does not evaluate anyExcludeMapspecifications. If you do not specify anIncludeMap, then Firewall Manager applies the policy to all accounts except for those specified by theExcludeMap.You can specify account IDs, OUs, or a combination:
-
Specify account IDs by setting the key to
ACCOUNT. For example, the following is a valid map:{“ACCOUNT” : [“accountID1”, “accountID2”]}. -
Specify OUs by setting the key to
ORG_UNIT. For example, the following is a valid map:{“ORG_UNIT” : [“ouid111”, “ouid112”]}. -
Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map:
{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
resourceSetIds
Policy.Builder resourceSetIds(Collection<String> resourceSetIds)
The unique identifiers of the resource sets used by the policy.
- Parameters:
resourceSetIds- The unique identifiers of the resource sets used by the policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
resourceSetIds
Policy.Builder resourceSetIds(String... resourceSetIds)
The unique identifiers of the resource sets used by the policy.
- Parameters:
resourceSetIds- The unique identifiers of the resource sets used by the policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
policyDescription
Policy.Builder policyDescription(String policyDescription)
Your description of the Firewall Manager policy.
- Parameters:
policyDescription- Your description of the Firewall Manager policy.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
policyStatus
Policy.Builder policyStatus(String policyStatus)
Indicates whether the policy is in or out of an admin's policy or Region scope.
-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
- Parameters:
policyStatus- Indicates whether the policy is in or out of an admin's policy or Region scope.-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
CustomerPolicyStatus,CustomerPolicyStatus
-
-
policyStatus
Policy.Builder policyStatus(CustomerPolicyStatus policyStatus)
Indicates whether the policy is in or out of an admin's policy or Region scope.
-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
- Parameters:
policyStatus- Indicates whether the policy is in or out of an admin's policy or Region scope.-
ACTIVE- The administrator can manage and delete the policy. -
OUT_OF_ADMIN_SCOPE- The administrator can view the policy, but they can't edit or delete the policy. Existing policy protections stay in place. Any new resources that come into scope of the policy won't be protected.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
CustomerPolicyStatus,CustomerPolicyStatus
-
-
-