#[non_exhaustive]pub struct Policy {Show 16 fields
pub policy_id: Option<String>,
pub policy_name: String,
pub policy_update_token: Option<String>,
pub security_service_policy_data: Option<SecurityServicePolicyData>,
pub resource_type: String,
pub resource_type_list: Option<Vec<String>>,
pub resource_tags: Option<Vec<ResourceTag>>,
pub exclude_resource_tags: bool,
pub remediation_enabled: bool,
pub delete_unused_fm_managed_resources: bool,
pub include_map: Option<HashMap<CustomerPolicyScopeIdType, Vec<String>>>,
pub exclude_map: Option<HashMap<CustomerPolicyScopeIdType, Vec<String>>>,
pub resource_set_ids: Option<Vec<String>>,
pub policy_description: Option<String>,
pub policy_status: Option<CustomerPolicyStatus>,
pub resource_tag_logical_operator: Option<ResourceTagLogicalOperator>,
}
Expand description
An Firewall Manager policy.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.policy_id: Option<String>
The ID of the Firewall Manager policy.
policy_name: String
The name of the Firewall Manager policy.
policy_update_token: Option<String>
A unique identifier for each update to the policy. When issuing a PutPolicy
request, the PolicyUpdateToken
in the request must match the PolicyUpdateToken
of the current policy version. To get the PolicyUpdateToken
of the current policy version, use a GetPolicy
request.
security_service_policy_data: Option<SecurityServicePolicyData>
Details about the security service that is being used to protect the resources.
resource_type: String
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 ResourceTypeList
and then specify the resource types in a ResourceTypeList
.
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
.
resource_type_list: Option<Vec<String>>
An array of ResourceType
objects. Use this only to specify multiple resource types. To specify a single resource type, use ResourceType
.
An array of ResourceTag
objects.
If set to True
, resources with the tags that are specified in the ResourceTag
array are not in scope of the policy. If set to False
, and the ResourceTag
array is not null, only resources with the specified tags are in scope of the policy.
remediation_enabled: bool
Indicates if the policy should be automatically applied to new resources.
delete_unused_fm_managed_resources: bool
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.
include_map: Option<HashMap<CustomerPolicyScopeIdType, Vec<String>>>
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 the IncludeMap
, and does not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
.
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”\]}
.
exclude_map: Option<HashMap<CustomerPolicyScopeIdType, Vec<String>>>
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 the IncludeMap
, and does not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
.
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”\]}
.
resource_set_ids: Option<Vec<String>>
The unique identifiers of the resource sets used by the policy.
policy_description: Option<String>
Your description of the Firewall Manager policy.
policy_status: Option<CustomerPolicyStatus>
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.
resource_tag_logical_operator: Option<ResourceTagLogicalOperator>
Specifies whether to combine multiple resource tags with AND, so that a resource must have all tags to be included or excluded, or OR, so that a resource must have at least one tag.
Default: AND
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn policy_name(&self) -> &str
pub fn policy_name(&self) -> &str
The name of the Firewall Manager policy.
Sourcepub fn policy_update_token(&self) -> Option<&str>
pub fn policy_update_token(&self) -> Option<&str>
A unique identifier for each update to the policy. When issuing a PutPolicy
request, the PolicyUpdateToken
in the request must match the PolicyUpdateToken
of the current policy version. To get the PolicyUpdateToken
of the current policy version, use a GetPolicy
request.
Sourcepub fn security_service_policy_data(&self) -> Option<&SecurityServicePolicyData>
pub fn security_service_policy_data(&self) -> Option<&SecurityServicePolicyData>
Details about the security service that is being used to protect the resources.
Sourcepub fn resource_type(&self) -> &str
pub fn resource_type(&self) -> &str
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 ResourceTypeList
and then specify the resource types in a ResourceTypeList
.
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
.
Sourcepub fn resource_type_list(&self) -> &[String]
pub fn resource_type_list(&self) -> &[String]
An array of ResourceType
objects. Use this only to specify multiple resource types. To specify a single resource type, use ResourceType
.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .resource_type_list.is_none()
.
An array of ResourceTag
objects.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .resource_tags.is_none()
.
If set to True
, resources with the tags that are specified in the ResourceTag
array are not in scope of the policy. If set to False
, and the ResourceTag
array is not null, only resources with the specified tags are in scope of the policy.
Sourcepub fn remediation_enabled(&self) -> bool
pub fn remediation_enabled(&self) -> bool
Indicates if the policy should be automatically applied to new resources.
Sourcepub fn delete_unused_fm_managed_resources(&self) -> bool
pub fn delete_unused_fm_managed_resources(&self) -> bool
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.
Sourcepub fn include_map(
&self,
) -> Option<&HashMap<CustomerPolicyScopeIdType, Vec<String>>>
pub fn include_map( &self, ) -> Option<&HashMap<CustomerPolicyScopeIdType, Vec<String>>>
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 the IncludeMap
, and does not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
.
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”\]}
.
Sourcepub fn exclude_map(
&self,
) -> Option<&HashMap<CustomerPolicyScopeIdType, Vec<String>>>
pub fn exclude_map( &self, ) -> Option<&HashMap<CustomerPolicyScopeIdType, Vec<String>>>
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 the IncludeMap
, and does not evaluate any ExcludeMap
specifications. If you do not specify an IncludeMap
, then Firewall Manager applies the policy to all accounts except for those specified by the ExcludeMap
.
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”\]}
.
Sourcepub fn resource_set_ids(&self) -> &[String]
pub fn resource_set_ids(&self) -> &[String]
The unique identifiers of the resource sets used by the policy.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .resource_set_ids.is_none()
.
Sourcepub fn policy_description(&self) -> Option<&str>
pub fn policy_description(&self) -> Option<&str>
Your description of the Firewall Manager policy.
Sourcepub fn policy_status(&self) -> Option<&CustomerPolicyStatus>
pub fn policy_status(&self) -> Option<&CustomerPolicyStatus>
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.
Sourcepub fn resource_tag_logical_operator(
&self,
) -> Option<&ResourceTagLogicalOperator>
pub fn resource_tag_logical_operator( &self, ) -> Option<&ResourceTagLogicalOperator>
Specifies whether to combine multiple resource tags with AND, so that a resource must have all tags to be included or excluded, or OR, so that a resource must have at least one tag.
Default: AND
Trait Implementations§
impl StructuralPartialEq for Policy
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnwindSafe for Policy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);