Class CfnGuardHookProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnGuardHookProps>
- Enclosing interface:
CfnGuardHookProps
CfnGuardHookProps-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofCfnGuardHookProps.getAlias()build()Builds the configured instance.executionRole(String executionRole) Sets the value ofCfnGuardHookProps.getExecutionRole()failureMode(String failureMode) Sets the value ofCfnGuardHookProps.getFailureMode()hookStatus(String hookStatus) Sets the value ofCfnGuardHookProps.getHookStatus()Sets the value ofCfnGuardHookProps.getLogBucket()options(IResolvable options) Sets the value ofCfnGuardHookProps.getOptions()options(CfnGuardHook.OptionsProperty options) Sets the value ofCfnGuardHookProps.getOptions()ruleLocation(IResolvable ruleLocation) Sets the value ofCfnGuardHookProps.getRuleLocation()ruleLocation(CfnGuardHook.S3LocationProperty ruleLocation) Sets the value ofCfnGuardHookProps.getRuleLocation()stackFilters(IResolvable stackFilters) Sets the value ofCfnGuardHookProps.getStackFilters()stackFilters(CfnGuardHook.StackFiltersProperty stackFilters) Sets the value ofCfnGuardHookProps.getStackFilters()targetFilters(IResolvable targetFilters) Sets the value ofCfnGuardHookProps.getTargetFilters()targetFilters(CfnGuardHook.TargetFiltersProperty targetFilters) Sets the value ofCfnGuardHookProps.getTargetFilters()targetOperations(List<String> targetOperations) Sets the value ofCfnGuardHookProps.getTargetOperations()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
alias
Sets the value ofCfnGuardHookProps.getAlias()- Parameters:
alias- The type name alias for the Hook. This alias must be unique per account and Region. This parameter is required. The alias must be in the formName1::Name2::Name3and must not begin withAWS. For example,Private::Guard::MyTestHook.- Returns:
this
-
executionRole
Sets the value ofCfnGuardHookProps.getExecutionRole()- Parameters:
executionRole- The IAM role that the Hook assumes to retrieve your Guard rules from S3 and optionally write a detailed Guard output report back. This parameter is required.- Returns:
this
-
failureMode
Sets the value ofCfnGuardHookProps.getFailureMode()- Parameters:
failureMode- Specifies how the Hook responds when rules fail their evaluation. This parameter is required.FAIL: Prevents the action from proceeding. This is helpful for enforcing strict compliance or security policies.WARN: Issues warnings to users but allows actions to continue. This is useful for non-critical validations or informational checks.
- Returns:
this
-
hookStatus
Sets the value ofCfnGuardHookProps.getHookStatus()- Parameters:
hookStatus- Specifies if the Hook isENABLEDorDISABLED. This parameter is required.- Returns:
this
-
ruleLocation
Sets the value ofCfnGuardHookProps.getRuleLocation()- Parameters:
ruleLocation- Specifies the S3 location of your Guard rules. This parameter is required.- Returns:
this
-
ruleLocation
@Stability(Stable) public CfnGuardHookProps.Builder ruleLocation(CfnGuardHook.S3LocationProperty ruleLocation) Sets the value ofCfnGuardHookProps.getRuleLocation()- Parameters:
ruleLocation- Specifies the S3 location of your Guard rules. This parameter is required.- Returns:
this
-
targetOperations
Sets the value ofCfnGuardHookProps.getTargetOperations()- Parameters:
targetOperations- Specifies the list of operations the Hook is run against. This parameter is required. For more information, see Hook targets in the AWS CloudFormation Hooks User Guide .Valid values:
STACK|RESOURCE|CHANGE_SET|CLOUD_CONTROL- Returns:
this
-
logBucket
Sets the value ofCfnGuardHookProps.getLogBucket()- Parameters:
logBucket- Specifies the name of an S3 bucket to store the Guard output report. This report contains the results of your Guard rule validations.- Returns:
this
-
options
Sets the value ofCfnGuardHookProps.getOptions()- Parameters:
options- Specifies the S3 location of your input parameters.- Returns:
this
-
options
Sets the value ofCfnGuardHookProps.getOptions()- Parameters:
options- Specifies the S3 location of your input parameters.- Returns:
this
-
stackFilters
Sets the value ofCfnGuardHookProps.getStackFilters()- Parameters:
stackFilters- Specifies the stack level filters for the Hook. Example stack level filter in JSON:"StackFilters": {"FilteringCriteria": "ALL", "StackNames": {"Exclude": [ "stack-1", "stack-2"]}}Example stack level filter in YAML:
StackFilters: FilteringCriteria: ALL StackNames: Exclude: - stack-1 - stack-2- Returns:
this
-
stackFilters
@Stability(Stable) public CfnGuardHookProps.Builder stackFilters(CfnGuardHook.StackFiltersProperty stackFilters) Sets the value ofCfnGuardHookProps.getStackFilters()- Parameters:
stackFilters- Specifies the stack level filters for the Hook. Example stack level filter in JSON:"StackFilters": {"FilteringCriteria": "ALL", "StackNames": {"Exclude": [ "stack-1", "stack-2"]}}Example stack level filter in YAML:
StackFilters: FilteringCriteria: ALL StackNames: Exclude: - stack-1 - stack-2- Returns:
this
-
targetFilters
Sets the value ofCfnGuardHookProps.getTargetFilters()- Parameters:
targetFilters- Specifies the target filters for the Hook. Example target filter in JSON:"TargetFilters": {"Actions": [ "CREATE", "UPDATE", "DELETE" ]}Example target filter in YAML:
TargetFilters: Actions: - CREATE - UPDATE - DELETE- Returns:
this
-
targetFilters
@Stability(Stable) public CfnGuardHookProps.Builder targetFilters(CfnGuardHook.TargetFiltersProperty targetFilters) Sets the value ofCfnGuardHookProps.getTargetFilters()- Parameters:
targetFilters- Specifies the target filters for the Hook. Example target filter in JSON:"TargetFilters": {"Actions": [ "CREATE", "UPDATE", "DELETE" ]}Example target filter in YAML:
TargetFilters: Actions: - CREATE - UPDATE - DELETE- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnGuardHookProps>- Returns:
- a new instance of
CfnGuardHookProps - Throws:
NullPointerException- if any required attribute was not provided
-