aws-cdk-lib 2.185.0__py3-none-any.whl → 2.186.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aws-cdk-lib might be problematic. Click here for more details.

Files changed (49) hide show
  1. aws_cdk/__init__.py +102 -29
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.185.0.jsii.tgz → aws-cdk-lib@2.186.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_amazonmq/__init__.py +3 -2
  5. aws_cdk/aws_apigatewayv2/__init__.py +9 -0
  6. aws_cdk/aws_appconfig/__init__.py +3 -3
  7. aws_cdk/aws_applicationsignals/__init__.py +363 -3
  8. aws_cdk/aws_appsync/__init__.py +65 -3
  9. aws_cdk/aws_bedrock/__init__.py +385 -14
  10. aws_cdk/aws_cleanrooms/__init__.py +21 -9
  11. aws_cdk/aws_cloudformation/__init__.py +1 -5
  12. aws_cdk/aws_cloudfront/__init__.py +4 -1
  13. aws_cdk/aws_cloudfront_origins/__init__.py +4 -2
  14. aws_cdk/aws_codeartifact/__init__.py +20 -33
  15. aws_cdk/aws_codepipeline/__init__.py +1328 -120
  16. aws_cdk/aws_cognito/__init__.py +1 -1
  17. aws_cdk/aws_cognito_identitypool/__init__.py +2303 -0
  18. aws_cdk/aws_connect/__init__.py +3 -7
  19. aws_cdk/aws_controltower/__init__.py +18 -26
  20. aws_cdk/aws_datazone/__init__.py +3471 -2
  21. aws_cdk/aws_ec2/__init__.py +560 -25
  22. aws_cdk/aws_ecs/__init__.py +15 -20
  23. aws_cdk/aws_events/__init__.py +37 -14
  24. aws_cdk/aws_gamelift/__init__.py +5 -5
  25. aws_cdk/aws_iam/__init__.py +264 -0
  26. aws_cdk/aws_imagebuilder/__init__.py +3 -27
  27. aws_cdk/aws_kinesisfirehose/__init__.py +2 -3
  28. aws_cdk/aws_lambda/__init__.py +7 -1
  29. aws_cdk/aws_location/__init__.py +24 -7
  30. aws_cdk/aws_msk/__init__.py +8 -2
  31. aws_cdk/aws_networkfirewall/__init__.py +16 -12
  32. aws_cdk/aws_oam/__init__.py +8 -37
  33. aws_cdk/aws_quicksight/__init__.py +6 -69
  34. aws_cdk/aws_redshiftserverless/__init__.py +192 -15
  35. aws_cdk/aws_rum/__init__.py +315 -52
  36. aws_cdk/aws_scheduler/__init__.py +3944 -121
  37. aws_cdk/aws_scheduler_targets/__init__.py +4472 -0
  38. aws_cdk/aws_ssmquicksetup/__init__.py +5 -3
  39. aws_cdk/aws_stepfunctions/__init__.py +17 -15
  40. aws_cdk/aws_timestream/__init__.py +4 -4
  41. aws_cdk/aws_wafv2/__init__.py +345 -0
  42. aws_cdk/aws_workspacesthinclient/__init__.py +4 -4
  43. aws_cdk/cx_api/__init__.py +23 -0
  44. {aws_cdk_lib-2.185.0.dist-info → aws_cdk_lib-2.186.0.dist-info}/METADATA +1 -1
  45. {aws_cdk_lib-2.185.0.dist-info → aws_cdk_lib-2.186.0.dist-info}/RECORD +49 -47
  46. {aws_cdk_lib-2.185.0.dist-info → aws_cdk_lib-2.186.0.dist-info}/LICENSE +0 -0
  47. {aws_cdk_lib-2.185.0.dist-info → aws_cdk_lib-2.186.0.dist-info}/NOTICE +0 -0
  48. {aws_cdk_lib-2.185.0.dist-info → aws_cdk_lib-2.186.0.dist-info}/WHEEL +0 -0
  49. {aws_cdk_lib-2.185.0.dist-info → aws_cdk_lib-2.186.0.dist-info}/top_level.txt +0 -0
@@ -582,7 +582,7 @@ The triggers can only be used with pipeline type V2.
582
582
  ### Push filter
583
583
 
584
584
  Pipelines can be started based on push events. You can specify the `pushFilter` property to
585
- filter the push events. The `pushFilter` can specify Git tags.
585
+ filter the push events. The `pushFilter` can specify Git tags and branches.
586
586
 
587
587
  In the case of Git tags, your pipeline starts when a Git tag is pushed.
588
588
  You can filter with glob patterns. The `tagsExcludes` takes priority over the `tagsIncludes`.
@@ -615,6 +615,70 @@ codepipeline.Pipeline(self, "Pipeline",
615
615
  )
616
616
  ```
617
617
 
618
+ In the case of branches, your pipeline starts when a commit is pushed on the specified branches.
619
+ You can filter with glob patterns. The `branchesExcludes` takes priority over the `branchesIncludes`.
620
+
621
+ ```python
622
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
623
+ # build_action: codepipeline_actions.CodeBuildAction
624
+
625
+
626
+ codepipeline.Pipeline(self, "Pipeline",
627
+ pipeline_type=codepipeline.PipelineType.V2,
628
+ stages=[codepipeline.StageProps(
629
+ stage_name="Source",
630
+ actions=[source_action]
631
+ ), codepipeline.StageProps(
632
+ stage_name="Build",
633
+ actions=[build_action]
634
+ )
635
+ ],
636
+ triggers=[codepipeline.TriggerProps(
637
+ provider_type=codepipeline.ProviderType.CODE_STAR_SOURCE_CONNECTION,
638
+ git_configuration=codepipeline.GitConfiguration(
639
+ source_action=source_action,
640
+ push_filter=[codepipeline.GitPushFilter(
641
+ branches_excludes=["exclude1", "exclude2"],
642
+ branches_includes=["include*"]
643
+ )]
644
+ )
645
+ )]
646
+ )
647
+ ```
648
+
649
+ File paths can also be specified along with the branches to start the pipeline.
650
+ You can filter with glob patterns. The `filePathsExcludes` takes priority over the `filePathsIncludes`.
651
+
652
+ ```python
653
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
654
+ # build_action: codepipeline_actions.CodeBuildAction
655
+
656
+
657
+ codepipeline.Pipeline(self, "Pipeline",
658
+ pipeline_type=codepipeline.PipelineType.V2,
659
+ stages=[codepipeline.StageProps(
660
+ stage_name="Source",
661
+ actions=[source_action]
662
+ ), codepipeline.StageProps(
663
+ stage_name="Build",
664
+ actions=[build_action]
665
+ )
666
+ ],
667
+ triggers=[codepipeline.TriggerProps(
668
+ provider_type=codepipeline.ProviderType.CODE_STAR_SOURCE_CONNECTION,
669
+ git_configuration=codepipeline.GitConfiguration(
670
+ source_action=source_action,
671
+ push_filter=[codepipeline.GitPushFilter(
672
+ branches_excludes=["exclude1", "exclude2"],
673
+ branches_includes=["include1", "include2"],
674
+ file_paths_excludes=["/path/to/exclude1", "/path/to/exclude2"],
675
+ file_paths_includes=["/path/to/include1", "/path/to/include1"]
676
+ )]
677
+ )
678
+ )]
679
+ )
680
+ ```
681
+
618
682
  ### Pull request filter
619
683
 
620
684
  Pipelines can be started based on pull request events. You can specify the `pullRequestFilter` property to
@@ -750,6 +814,86 @@ codepipeline.Pipeline(self, "Pipeline",
750
814
  )
751
815
  ```
752
816
 
817
+ ## Stage Level Condition
818
+
819
+ Conditions are used for specific types of expressions and each has specific options for results available as follows:
820
+
821
+ ```
822
+ Entry - The conditions for making checks that, if met, allow entry to a stage. Rules are engaged with the following result options: Fail or Skip
823
+
824
+ On Failure - The conditions for making checks for the stage when it fails. Rules are engaged with the following result option: Rollback
825
+
826
+ On Success - The conditions for making checks for the stage when it succeeds. Rules are engaged with the following result options: Rollback or Fail
827
+ ```
828
+
829
+ Conditions are supported by a set of rules for each type of condition.
830
+
831
+ For each type of condition, there are specific actions that are set up by the condition. The action is the result of the succeeded or failed condition check. For example, the condition for entry (entry condition) encounters an alarm (rule), then the check is successful and the result (action) is that the stage entry is blocked.
832
+
833
+ ```python
834
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
835
+ # build_action: codepipeline_actions.CodeBuildAction
836
+
837
+
838
+ codepipeline.Pipeline(self, "Pipeline",
839
+ pipeline_type=codepipeline.PipelineType.V2,
840
+ stages=[codepipeline.StageProps(
841
+ stage_name="Source",
842
+ actions=[source_action]
843
+ ), codepipeline.StageProps(
844
+ stage_name="Build",
845
+ actions=[build_action],
846
+ # BeforeEntry condition - checks before entering the stage
847
+ before_entry=codepipeline.Conditions(
848
+ conditions=[codepipeline.Condition(
849
+ rules=[codepipeline.Rule(
850
+ name="LambdaCheck",
851
+ provider="LambdaInvoke",
852
+ version="1",
853
+ configuration={
854
+ "FunctionName": "LambdaFunctionName"
855
+ }
856
+ )],
857
+ result=codepipeline.Result.FAIL
858
+ )]
859
+ ),
860
+ # OnSuccess condition - checks after successful stage completion
861
+ on_success=codepipeline.Conditions(
862
+ conditions=[codepipeline.Condition(
863
+ result=codepipeline.Result.FAIL,
864
+ rules=[codepipeline.Rule(
865
+ name="CloudWatchCheck",
866
+ provider="LambdaInvoke",
867
+ version="1",
868
+ configuration={
869
+ "AlarmName": "AlarmName1",
870
+ "WaitTime": "300", # 5 minutes
871
+ "FunctionName": "funcName2"
872
+ }
873
+ )]
874
+ )]
875
+ ),
876
+ # OnFailure condition - handles stage failure
877
+ on_failure=codepipeline.FailureConditions(
878
+ conditions=[codepipeline.Condition(
879
+ result=codepipeline.Result.ROLLBACK,
880
+ rules=[codepipeline.Rule(
881
+ name="RollBackOnFailure",
882
+ provider="LambdaInvoke",
883
+ version="1",
884
+ configuration={
885
+ "AlarmName": "Alarm",
886
+ "WaitTime": "300", # 5 minutes
887
+ "FunctionName": "funcName1"
888
+ }
889
+ )]
890
+ )]
891
+ )
892
+ )
893
+ ]
894
+ )
895
+ ```
896
+
753
897
  ## Migrating a pipeline type from V1 to V2
754
898
 
755
899
  To migrate your pipeline type from V1 to V2, you just need to update the `pipelineType` property to `PipelineType.V2`.
@@ -831,7 +975,9 @@ from ..aws_events import (
831
975
  Schedule as _Schedule_c151d01f,
832
976
  )
833
977
  from ..aws_iam import (
834
- IRole as _IRole_235f5d8e, PolicyStatement as _PolicyStatement_0fe33853
978
+ IRole as _IRole_235f5d8e,
979
+ PolicyStatement as _PolicyStatement_0fe33853,
980
+ Role as _Role_e8c6e11f,
835
981
  )
836
982
  from ..aws_s3 import IBucket as _IBucket_42e086fd, Location as _Location_0948fa7f
837
983
 
@@ -6986,6 +7132,189 @@ class CommonAwsActionProps(CommonActionProps):
6986
7132
  )
6987
7133
 
6988
7134
 
7135
+ @jsii.data_type(
7136
+ jsii_type="aws-cdk-lib.aws_codepipeline.Condition",
7137
+ jsii_struct_bases=[],
7138
+ name_mapping={"result": "result", "rules": "rules"},
7139
+ )
7140
+ class Condition:
7141
+ def __init__(
7142
+ self,
7143
+ *,
7144
+ result: typing.Optional["Result"] = None,
7145
+ rules: typing.Optional[typing.Sequence["Rule"]] = None,
7146
+ ) -> None:
7147
+ '''The condition for the stage.
7148
+
7149
+ A condition is made up of the rules and the result for the condition.
7150
+
7151
+ :param result: The action to be done when the condition is met. Default: - No result action is taken
7152
+ :param rules: The rules that make up the condition. Default: - No rules are applied
7153
+
7154
+ :exampleMetadata: fixture=_generated
7155
+
7156
+ Example::
7157
+
7158
+ # The code below shows an example of how to instantiate this type.
7159
+ # The values are placeholders you should change.
7160
+ from aws_cdk import aws_codepipeline as codepipeline
7161
+
7162
+ # rule: codepipeline.Rule
7163
+
7164
+ condition = codepipeline.Condition(
7165
+ result=codepipeline.Result.ROLLBACK,
7166
+ rules=[rule]
7167
+ )
7168
+ '''
7169
+ if __debug__:
7170
+ type_hints = typing.get_type_hints(_typecheckingstub__f9d3d585d6146668bf50fd9ef4e444521a4def40f934c6c42bb219a9816ffc01)
7171
+ check_type(argname="argument result", value=result, expected_type=type_hints["result"])
7172
+ check_type(argname="argument rules", value=rules, expected_type=type_hints["rules"])
7173
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
7174
+ if result is not None:
7175
+ self._values["result"] = result
7176
+ if rules is not None:
7177
+ self._values["rules"] = rules
7178
+
7179
+ @builtins.property
7180
+ def result(self) -> typing.Optional["Result"]:
7181
+ '''The action to be done when the condition is met.
7182
+
7183
+ :default: - No result action is taken
7184
+ '''
7185
+ result = self._values.get("result")
7186
+ return typing.cast(typing.Optional["Result"], result)
7187
+
7188
+ @builtins.property
7189
+ def rules(self) -> typing.Optional[typing.List["Rule"]]:
7190
+ '''The rules that make up the condition.
7191
+
7192
+ :default: - No rules are applied
7193
+ '''
7194
+ result = self._values.get("rules")
7195
+ return typing.cast(typing.Optional[typing.List["Rule"]], result)
7196
+
7197
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
7198
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
7199
+
7200
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
7201
+ return not (rhs == self)
7202
+
7203
+ def __repr__(self) -> str:
7204
+ return "Condition(%s)" % ", ".join(
7205
+ k + "=" + repr(v) for k, v in self._values.items()
7206
+ )
7207
+
7208
+
7209
+ @jsii.data_type(
7210
+ jsii_type="aws-cdk-lib.aws_codepipeline.Conditions",
7211
+ jsii_struct_bases=[],
7212
+ name_mapping={"conditions": "conditions"},
7213
+ )
7214
+ class Conditions:
7215
+ def __init__(
7216
+ self,
7217
+ *,
7218
+ conditions: typing.Optional[typing.Sequence[typing.Union[Condition, typing.Dict[builtins.str, typing.Any]]]] = None,
7219
+ ) -> None:
7220
+ '''The conditions for making checks for the stage.
7221
+
7222
+ :param conditions: The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage. Default: - No conditions are configured
7223
+
7224
+ :exampleMetadata: infused
7225
+
7226
+ Example::
7227
+
7228
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
7229
+ # build_action: codepipeline_actions.CodeBuildAction
7230
+
7231
+
7232
+ codepipeline.Pipeline(self, "Pipeline",
7233
+ pipeline_type=codepipeline.PipelineType.V2,
7234
+ stages=[codepipeline.StageProps(
7235
+ stage_name="Source",
7236
+ actions=[source_action]
7237
+ ), codepipeline.StageProps(
7238
+ stage_name="Build",
7239
+ actions=[build_action],
7240
+ # BeforeEntry condition - checks before entering the stage
7241
+ before_entry=codepipeline.Conditions(
7242
+ conditions=[codepipeline.Condition(
7243
+ rules=[codepipeline.Rule(
7244
+ name="LambdaCheck",
7245
+ provider="LambdaInvoke",
7246
+ version="1",
7247
+ configuration={
7248
+ "FunctionName": "LambdaFunctionName"
7249
+ }
7250
+ )],
7251
+ result=codepipeline.Result.FAIL
7252
+ )]
7253
+ ),
7254
+ # OnSuccess condition - checks after successful stage completion
7255
+ on_success=codepipeline.Conditions(
7256
+ conditions=[codepipeline.Condition(
7257
+ result=codepipeline.Result.FAIL,
7258
+ rules=[codepipeline.Rule(
7259
+ name="CloudWatchCheck",
7260
+ provider="LambdaInvoke",
7261
+ version="1",
7262
+ configuration={
7263
+ "AlarmName": "AlarmName1",
7264
+ "WaitTime": "300", # 5 minutes
7265
+ "FunctionName": "funcName2"
7266
+ }
7267
+ )]
7268
+ )]
7269
+ ),
7270
+ # OnFailure condition - handles stage failure
7271
+ on_failure=codepipeline.FailureConditions(
7272
+ conditions=[codepipeline.Condition(
7273
+ result=codepipeline.Result.ROLLBACK,
7274
+ rules=[codepipeline.Rule(
7275
+ name="RollBackOnFailure",
7276
+ provider="LambdaInvoke",
7277
+ version="1",
7278
+ configuration={
7279
+ "AlarmName": "Alarm",
7280
+ "WaitTime": "300", # 5 minutes
7281
+ "FunctionName": "funcName1"
7282
+ }
7283
+ )]
7284
+ )]
7285
+ )
7286
+ )
7287
+ ]
7288
+ )
7289
+ '''
7290
+ if __debug__:
7291
+ type_hints = typing.get_type_hints(_typecheckingstub__b1d234052e60461c20b06295a40d2efb73b7297f0a204252511a0083c29daef9)
7292
+ check_type(argname="argument conditions", value=conditions, expected_type=type_hints["conditions"])
7293
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
7294
+ if conditions is not None:
7295
+ self._values["conditions"] = conditions
7296
+
7297
+ @builtins.property
7298
+ def conditions(self) -> typing.Optional[typing.List[Condition]]:
7299
+ '''The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage.
7300
+
7301
+ :default: - No conditions are configured
7302
+ '''
7303
+ result = self._values.get("conditions")
7304
+ return typing.cast(typing.Optional[typing.List[Condition]], result)
7305
+
7306
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
7307
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
7308
+
7309
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
7310
+ return not (rhs == self)
7311
+
7312
+ def __repr__(self) -> str:
7313
+ return "Conditions(%s)" % ", ".join(
7314
+ k + "=" + repr(v) for k, v in self._values.items()
7315
+ )
7316
+
7317
+
6989
7318
  @jsii.data_type(
6990
7319
  jsii_type="aws-cdk-lib.aws_codepipeline.CrossRegionSupport",
6991
7320
  jsii_struct_bases=[],
@@ -7510,27 +7839,27 @@ class ExecutionMode(enum.Enum):
7510
7839
 
7511
7840
 
7512
7841
  @jsii.data_type(
7513
- jsii_type="aws-cdk-lib.aws_codepipeline.GitConfiguration",
7514
- jsii_struct_bases=[],
7842
+ jsii_type="aws-cdk-lib.aws_codepipeline.FailureConditions",
7843
+ jsii_struct_bases=[Conditions],
7515
7844
  name_mapping={
7516
- "source_action": "sourceAction",
7517
- "pull_request_filter": "pullRequestFilter",
7518
- "push_filter": "pushFilter",
7845
+ "conditions": "conditions",
7846
+ "result": "result",
7847
+ "retry_mode": "retryMode",
7519
7848
  },
7520
7849
  )
7521
- class GitConfiguration:
7850
+ class FailureConditions(Conditions):
7522
7851
  def __init__(
7523
7852
  self,
7524
7853
  *,
7525
- source_action: "IAction",
7526
- pull_request_filter: typing.Optional[typing.Sequence[typing.Union["GitPullRequestFilter", typing.Dict[builtins.str, typing.Any]]]] = None,
7527
- push_filter: typing.Optional[typing.Sequence[typing.Union["GitPushFilter", typing.Dict[builtins.str, typing.Any]]]] = None,
7854
+ conditions: typing.Optional[typing.Sequence[typing.Union[Condition, typing.Dict[builtins.str, typing.Any]]]] = None,
7855
+ result: typing.Optional["Result"] = None,
7856
+ retry_mode: typing.Optional["RetryMode"] = None,
7528
7857
  ) -> None:
7529
- '''Git configuration for trigger.
7858
+ '''The configuration that specifies the result, such as rollback, to occur upon stage failure.
7530
7859
 
7531
- :param source_action: The pipeline source action where the trigger configuration, such as Git tags. The trigger configuration will start the pipeline upon the specified change only. You can only specify one trigger configuration per source action. Since the provider for ``sourceAction`` must be ``CodeStarSourceConnection``, you can use ``CodeStarConnectionsSourceAction`` construct in ``aws-codepipeline-actions`` module.
7532
- :param pull_request_filter: The field where the repository event that will start the pipeline is specified as pull requests. The length must be less than or equal to 3. Default: - no filter.
7533
- :param push_filter: The field where the repository event that will start the pipeline, such as pushing Git tags, is specified with details. Git tags is the only supported event type. The length must be less than or equal to 3. Default: - no filter.
7860
+ :param conditions: The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage. Default: - No conditions are configured
7861
+ :param result: The specified result for when the failure conditions are met, such as rolling back the stage. Default: FAIL
7862
+ :param retry_mode: The method that you want to configure for automatic stage retry on stage failure. Default: ALL_ACTIONS
7534
7863
 
7535
7864
  :exampleMetadata: infused
7536
7865
 
@@ -7547,55 +7876,196 @@ class GitConfiguration:
7547
7876
  actions=[source_action]
7548
7877
  ), codepipeline.StageProps(
7549
7878
  stage_name="Build",
7550
- actions=[build_action]
7551
- )
7552
- ],
7553
- triggers=[codepipeline.TriggerProps(
7554
- provider_type=codepipeline.ProviderType.CODE_STAR_SOURCE_CONNECTION,
7555
- git_configuration=codepipeline.GitConfiguration(
7556
- source_action=source_action,
7557
- push_filter=[codepipeline.GitPushFilter(
7558
- tags_excludes=["exclude1", "exclude2"],
7559
- tags_includes=["include*"]
7879
+ actions=[build_action],
7880
+ # BeforeEntry condition - checks before entering the stage
7881
+ before_entry=codepipeline.Conditions(
7882
+ conditions=[codepipeline.Condition(
7883
+ rules=[codepipeline.Rule(
7884
+ name="LambdaCheck",
7885
+ provider="LambdaInvoke",
7886
+ version="1",
7887
+ configuration={
7888
+ "FunctionName": "LambdaFunctionName"
7889
+ }
7890
+ )],
7891
+ result=codepipeline.Result.FAIL
7892
+ )]
7893
+ ),
7894
+ # OnSuccess condition - checks after successful stage completion
7895
+ on_success=codepipeline.Conditions(
7896
+ conditions=[codepipeline.Condition(
7897
+ result=codepipeline.Result.FAIL,
7898
+ rules=[codepipeline.Rule(
7899
+ name="CloudWatchCheck",
7900
+ provider="LambdaInvoke",
7901
+ version="1",
7902
+ configuration={
7903
+ "AlarmName": "AlarmName1",
7904
+ "WaitTime": "300", # 5 minutes
7905
+ "FunctionName": "funcName2"
7906
+ }
7907
+ )]
7908
+ )]
7909
+ ),
7910
+ # OnFailure condition - handles stage failure
7911
+ on_failure=codepipeline.FailureConditions(
7912
+ conditions=[codepipeline.Condition(
7913
+ result=codepipeline.Result.ROLLBACK,
7914
+ rules=[codepipeline.Rule(
7915
+ name="RollBackOnFailure",
7916
+ provider="LambdaInvoke",
7917
+ version="1",
7918
+ configuration={
7919
+ "AlarmName": "Alarm",
7920
+ "WaitTime": "300", # 5 minutes
7921
+ "FunctionName": "funcName1"
7922
+ }
7923
+ )]
7560
7924
  )]
7561
7925
  )
7562
- )]
7926
+ )
7927
+ ]
7563
7928
  )
7564
7929
  '''
7565
7930
  if __debug__:
7566
- type_hints = typing.get_type_hints(_typecheckingstub__9bf0379bb3fa72f7dc00a45de6a383d19d18294c73d73dabcbdb7240e76832bf)
7567
- check_type(argname="argument source_action", value=source_action, expected_type=type_hints["source_action"])
7568
- check_type(argname="argument pull_request_filter", value=pull_request_filter, expected_type=type_hints["pull_request_filter"])
7569
- check_type(argname="argument push_filter", value=push_filter, expected_type=type_hints["push_filter"])
7570
- self._values: typing.Dict[builtins.str, typing.Any] = {
7571
- "source_action": source_action,
7572
- }
7573
- if pull_request_filter is not None:
7574
- self._values["pull_request_filter"] = pull_request_filter
7575
- if push_filter is not None:
7576
- self._values["push_filter"] = push_filter
7931
+ type_hints = typing.get_type_hints(_typecheckingstub__5c4e44cde413d4a9db86d96fc9c455622d0585f9fb8a399e230a3e6f73163569)
7932
+ check_type(argname="argument conditions", value=conditions, expected_type=type_hints["conditions"])
7933
+ check_type(argname="argument result", value=result, expected_type=type_hints["result"])
7934
+ check_type(argname="argument retry_mode", value=retry_mode, expected_type=type_hints["retry_mode"])
7935
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
7936
+ if conditions is not None:
7937
+ self._values["conditions"] = conditions
7938
+ if result is not None:
7939
+ self._values["result"] = result
7940
+ if retry_mode is not None:
7941
+ self._values["retry_mode"] = retry_mode
7577
7942
 
7578
7943
  @builtins.property
7579
- def source_action(self) -> "IAction":
7580
- '''The pipeline source action where the trigger configuration, such as Git tags.
7944
+ def conditions(self) -> typing.Optional[typing.List[Condition]]:
7945
+ '''The conditions that are configured as entry conditions, making check to succeed the stage, or fail the stage.
7581
7946
 
7582
- The trigger configuration will start the pipeline upon the specified change only.
7583
- You can only specify one trigger configuration per source action.
7947
+ :default: - No conditions are configured
7948
+ '''
7949
+ result = self._values.get("conditions")
7950
+ return typing.cast(typing.Optional[typing.List[Condition]], result)
7584
7951
 
7585
- Since the provider for ``sourceAction`` must be ``CodeStarSourceConnection``, you can use
7586
- ``CodeStarConnectionsSourceAction`` construct in ``aws-codepipeline-actions`` module.
7952
+ @builtins.property
7953
+ def result(self) -> typing.Optional["Result"]:
7954
+ '''The specified result for when the failure conditions are met, such as rolling back the stage.
7955
+
7956
+ :default: FAIL
7587
7957
  '''
7588
- result = self._values.get("source_action")
7589
- assert result is not None, "Required property 'source_action' is missing"
7590
- return typing.cast("IAction", result)
7958
+ result = self._values.get("result")
7959
+ return typing.cast(typing.Optional["Result"], result)
7591
7960
 
7592
7961
  @builtins.property
7593
- def pull_request_filter(
7594
- self,
7595
- ) -> typing.Optional[typing.List["GitPullRequestFilter"]]:
7596
- '''The field where the repository event that will start the pipeline is specified as pull requests.
7962
+ def retry_mode(self) -> typing.Optional["RetryMode"]:
7963
+ '''The method that you want to configure for automatic stage retry on stage failure.
7597
7964
 
7598
- The length must be less than or equal to 3.
7965
+ :default: ALL_ACTIONS
7966
+ '''
7967
+ result = self._values.get("retry_mode")
7968
+ return typing.cast(typing.Optional["RetryMode"], result)
7969
+
7970
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
7971
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
7972
+
7973
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
7974
+ return not (rhs == self)
7975
+
7976
+ def __repr__(self) -> str:
7977
+ return "FailureConditions(%s)" % ", ".join(
7978
+ k + "=" + repr(v) for k, v in self._values.items()
7979
+ )
7980
+
7981
+
7982
+ @jsii.data_type(
7983
+ jsii_type="aws-cdk-lib.aws_codepipeline.GitConfiguration",
7984
+ jsii_struct_bases=[],
7985
+ name_mapping={
7986
+ "source_action": "sourceAction",
7987
+ "pull_request_filter": "pullRequestFilter",
7988
+ "push_filter": "pushFilter",
7989
+ },
7990
+ )
7991
+ class GitConfiguration:
7992
+ def __init__(
7993
+ self,
7994
+ *,
7995
+ source_action: "IAction",
7996
+ pull_request_filter: typing.Optional[typing.Sequence[typing.Union["GitPullRequestFilter", typing.Dict[builtins.str, typing.Any]]]] = None,
7997
+ push_filter: typing.Optional[typing.Sequence[typing.Union["GitPushFilter", typing.Dict[builtins.str, typing.Any]]]] = None,
7998
+ ) -> None:
7999
+ '''Git configuration for trigger.
8000
+
8001
+ :param source_action: The pipeline source action where the trigger configuration, such as Git tags. The trigger configuration will start the pipeline upon the specified change only. You can only specify one trigger configuration per source action. Since the provider for ``sourceAction`` must be ``CodeStarSourceConnection``, you can use ``CodeStarConnectionsSourceAction`` construct in ``aws-codepipeline-actions`` module.
8002
+ :param pull_request_filter: The field where the repository event that will start the pipeline is specified as pull requests. The length must be less than or equal to 3. Default: - no filter.
8003
+ :param push_filter: The field where the repository event that will start the pipeline, such as pushing Git tags, is specified with details. Git tags, file paths and branches are supported event type. The length must be less than or equal to 3. Default: - no filter.
8004
+
8005
+ :exampleMetadata: infused
8006
+
8007
+ Example::
8008
+
8009
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
8010
+ # build_action: codepipeline_actions.CodeBuildAction
8011
+
8012
+
8013
+ codepipeline.Pipeline(self, "Pipeline",
8014
+ pipeline_type=codepipeline.PipelineType.V2,
8015
+ stages=[codepipeline.StageProps(
8016
+ stage_name="Source",
8017
+ actions=[source_action]
8018
+ ), codepipeline.StageProps(
8019
+ stage_name="Build",
8020
+ actions=[build_action]
8021
+ )
8022
+ ],
8023
+ triggers=[codepipeline.TriggerProps(
8024
+ provider_type=codepipeline.ProviderType.CODE_STAR_SOURCE_CONNECTION,
8025
+ git_configuration=codepipeline.GitConfiguration(
8026
+ source_action=source_action,
8027
+ push_filter=[codepipeline.GitPushFilter(
8028
+ tags_excludes=["exclude1", "exclude2"],
8029
+ tags_includes=["include*"]
8030
+ )]
8031
+ )
8032
+ )]
8033
+ )
8034
+ '''
8035
+ if __debug__:
8036
+ type_hints = typing.get_type_hints(_typecheckingstub__9bf0379bb3fa72f7dc00a45de6a383d19d18294c73d73dabcbdb7240e76832bf)
8037
+ check_type(argname="argument source_action", value=source_action, expected_type=type_hints["source_action"])
8038
+ check_type(argname="argument pull_request_filter", value=pull_request_filter, expected_type=type_hints["pull_request_filter"])
8039
+ check_type(argname="argument push_filter", value=push_filter, expected_type=type_hints["push_filter"])
8040
+ self._values: typing.Dict[builtins.str, typing.Any] = {
8041
+ "source_action": source_action,
8042
+ }
8043
+ if pull_request_filter is not None:
8044
+ self._values["pull_request_filter"] = pull_request_filter
8045
+ if push_filter is not None:
8046
+ self._values["push_filter"] = push_filter
8047
+
8048
+ @builtins.property
8049
+ def source_action(self) -> "IAction":
8050
+ '''The pipeline source action where the trigger configuration, such as Git tags.
8051
+
8052
+ The trigger configuration will start the pipeline upon the specified change only.
8053
+ You can only specify one trigger configuration per source action.
8054
+
8055
+ Since the provider for ``sourceAction`` must be ``CodeStarSourceConnection``, you can use
8056
+ ``CodeStarConnectionsSourceAction`` construct in ``aws-codepipeline-actions`` module.
8057
+ '''
8058
+ result = self._values.get("source_action")
8059
+ assert result is not None, "Required property 'source_action' is missing"
8060
+ return typing.cast("IAction", result)
8061
+
8062
+ @builtins.property
8063
+ def pull_request_filter(
8064
+ self,
8065
+ ) -> typing.Optional[typing.List["GitPullRequestFilter"]]:
8066
+ '''The field where the repository event that will start the pipeline is specified as pull requests.
8067
+
8068
+ The length must be less than or equal to 3.
7599
8069
 
7600
8070
  :default: - no filter.
7601
8071
  '''
@@ -7606,7 +8076,7 @@ class GitConfiguration:
7606
8076
  def push_filter(self) -> typing.Optional[typing.List["GitPushFilter"]]:
7607
8077
  '''The field where the repository event that will start the pipeline, such as pushing Git tags, is specified with details.
7608
8078
 
7609
- Git tags is the only supported event type.
8079
+ Git tags, file paths and branches are supported event type.
7610
8080
 
7611
8081
  The length must be less than or equal to 3.
7612
8082
 
@@ -7816,17 +8286,32 @@ class GitPullRequestFilter:
7816
8286
  @jsii.data_type(
7817
8287
  jsii_type="aws-cdk-lib.aws_codepipeline.GitPushFilter",
7818
8288
  jsii_struct_bases=[],
7819
- name_mapping={"tags_excludes": "tagsExcludes", "tags_includes": "tagsIncludes"},
8289
+ name_mapping={
8290
+ "branches_excludes": "branchesExcludes",
8291
+ "branches_includes": "branchesIncludes",
8292
+ "file_paths_excludes": "filePathsExcludes",
8293
+ "file_paths_includes": "filePathsIncludes",
8294
+ "tags_excludes": "tagsExcludes",
8295
+ "tags_includes": "tagsIncludes",
8296
+ },
7820
8297
  )
7821
8298
  class GitPushFilter:
7822
8299
  def __init__(
7823
8300
  self,
7824
8301
  *,
8302
+ branches_excludes: typing.Optional[typing.Sequence[builtins.str]] = None,
8303
+ branches_includes: typing.Optional[typing.Sequence[builtins.str]] = None,
8304
+ file_paths_excludes: typing.Optional[typing.Sequence[builtins.str]] = None,
8305
+ file_paths_includes: typing.Optional[typing.Sequence[builtins.str]] = None,
7825
8306
  tags_excludes: typing.Optional[typing.Sequence[builtins.str]] = None,
7826
8307
  tags_includes: typing.Optional[typing.Sequence[builtins.str]] = None,
7827
8308
  ) -> None:
7828
8309
  '''Git push filter for trigger.
7829
8310
 
8311
+ :param branches_excludes: The list of patterns of Git branches that, when pull request events occurs, are to be excluded from starting the pipeline. You can filter with glob patterns. The ``branchesExcludes`` takes priority over the ``branchesIncludes``. Maximum length of this array is 8. Default: - no branches.
8312
+ :param branches_includes: The list of patterns of Git branches that, when pull request events occurs, are to be included as criteria that starts the pipeline. You can filter with glob patterns. The ``branchesExcludes`` takes priority over the ``branchesIncludes``. Maximum length of this array is 8. Default: - no branches.
8313
+ :param file_paths_excludes: The list of patterns of Git repository file paths that, when pull request events occurs, are to be excluded from starting the pipeline. You can filter with glob patterns. The ``filePathsExcludes`` takes priority over the ``filePathsIncludes``. Maximum length of this array is 8. Default: - no filePaths.
8314
+ :param file_paths_includes: The list of patterns of Git repository file paths that, when pull request events occurs, are to be included as criteria that starts the pipeline. You can filter with glob patterns. The ``filePathsExcludes`` takes priority over the ``filePathsIncludes``. Maximum length of this array is 8. Default: - no filePaths.
7830
8315
  :param tags_excludes: The list of patterns of Git tags that, when pushed, are to be excluded from starting the pipeline. You can filter with glob patterns. The ``tagsExcludes`` takes priority over the ``tagsIncludes``. Maximum length of this array is 8. Default: - no tags.
7831
8316
  :param tags_includes: The list of patterns of Git tags that, when pushed, are to be included as criteria that starts the pipeline. You can filter with glob patterns. The ``tagsExcludes`` takes priority over the ``tagsIncludes``. Maximum length of this array is 8. Default: - no tags.
7832
8317
 
@@ -7839,20 +8324,92 @@ class GitPushFilter:
7839
8324
  from aws_cdk import aws_codepipeline as codepipeline
7840
8325
 
7841
8326
  git_push_filter = codepipeline.GitPushFilter(
8327
+ branches_excludes=["branchesExcludes"],
8328
+ branches_includes=["branchesIncludes"],
8329
+ file_paths_excludes=["filePathsExcludes"],
8330
+ file_paths_includes=["filePathsIncludes"],
7842
8331
  tags_excludes=["tagsExcludes"],
7843
8332
  tags_includes=["tagsIncludes"]
7844
8333
  )
7845
8334
  '''
7846
8335
  if __debug__:
7847
8336
  type_hints = typing.get_type_hints(_typecheckingstub__d2e5e6ae139c810aa752b8a8c7cd3040d883f9f3a67c8d3693f9ab842351804e)
8337
+ check_type(argname="argument branches_excludes", value=branches_excludes, expected_type=type_hints["branches_excludes"])
8338
+ check_type(argname="argument branches_includes", value=branches_includes, expected_type=type_hints["branches_includes"])
8339
+ check_type(argname="argument file_paths_excludes", value=file_paths_excludes, expected_type=type_hints["file_paths_excludes"])
8340
+ check_type(argname="argument file_paths_includes", value=file_paths_includes, expected_type=type_hints["file_paths_includes"])
7848
8341
  check_type(argname="argument tags_excludes", value=tags_excludes, expected_type=type_hints["tags_excludes"])
7849
8342
  check_type(argname="argument tags_includes", value=tags_includes, expected_type=type_hints["tags_includes"])
7850
8343
  self._values: typing.Dict[builtins.str, typing.Any] = {}
8344
+ if branches_excludes is not None:
8345
+ self._values["branches_excludes"] = branches_excludes
8346
+ if branches_includes is not None:
8347
+ self._values["branches_includes"] = branches_includes
8348
+ if file_paths_excludes is not None:
8349
+ self._values["file_paths_excludes"] = file_paths_excludes
8350
+ if file_paths_includes is not None:
8351
+ self._values["file_paths_includes"] = file_paths_includes
7851
8352
  if tags_excludes is not None:
7852
8353
  self._values["tags_excludes"] = tags_excludes
7853
8354
  if tags_includes is not None:
7854
8355
  self._values["tags_includes"] = tags_includes
7855
8356
 
8357
+ @builtins.property
8358
+ def branches_excludes(self) -> typing.Optional[typing.List[builtins.str]]:
8359
+ '''The list of patterns of Git branches that, when pull request events occurs, are to be excluded from starting the pipeline.
8360
+
8361
+ You can filter with glob patterns. The ``branchesExcludes`` takes priority
8362
+ over the ``branchesIncludes``.
8363
+
8364
+ Maximum length of this array is 8.
8365
+
8366
+ :default: - no branches.
8367
+ '''
8368
+ result = self._values.get("branches_excludes")
8369
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
8370
+
8371
+ @builtins.property
8372
+ def branches_includes(self) -> typing.Optional[typing.List[builtins.str]]:
8373
+ '''The list of patterns of Git branches that, when pull request events occurs, are to be included as criteria that starts the pipeline.
8374
+
8375
+ You can filter with glob patterns. The ``branchesExcludes`` takes priority
8376
+ over the ``branchesIncludes``.
8377
+
8378
+ Maximum length of this array is 8.
8379
+
8380
+ :default: - no branches.
8381
+ '''
8382
+ result = self._values.get("branches_includes")
8383
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
8384
+
8385
+ @builtins.property
8386
+ def file_paths_excludes(self) -> typing.Optional[typing.List[builtins.str]]:
8387
+ '''The list of patterns of Git repository file paths that, when pull request events occurs, are to be excluded from starting the pipeline.
8388
+
8389
+ You can filter with glob patterns. The ``filePathsExcludes`` takes priority
8390
+ over the ``filePathsIncludes``.
8391
+
8392
+ Maximum length of this array is 8.
8393
+
8394
+ :default: - no filePaths.
8395
+ '''
8396
+ result = self._values.get("file_paths_excludes")
8397
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
8398
+
8399
+ @builtins.property
8400
+ def file_paths_includes(self) -> typing.Optional[typing.List[builtins.str]]:
8401
+ '''The list of patterns of Git repository file paths that, when pull request events occurs, are to be included as criteria that starts the pipeline.
8402
+
8403
+ You can filter with glob patterns. The ``filePathsExcludes`` takes priority
8404
+ over the ``filePathsIncludes``.
8405
+
8406
+ Maximum length of this array is 8.
8407
+
8408
+ :default: - no filePaths.
8409
+ '''
8410
+ result = self._values.get("file_paths_includes")
8411
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
8412
+
7856
8413
  @builtins.property
7857
8414
  def tags_excludes(self) -> typing.Optional[typing.List[builtins.str]]:
7858
8415
  '''The list of patterns of Git tags that, when pushed, are to be excluded from starting the pipeline.
@@ -8819,6 +9376,9 @@ class Pipeline(
8819
9376
  placement: typing.Optional[typing.Union["StagePlacement", typing.Dict[builtins.str, typing.Any]]] = None,
8820
9377
  stage_name: builtins.str,
8821
9378
  actions: typing.Optional[typing.Sequence[IAction]] = None,
9379
+ before_entry: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
9380
+ on_failure: typing.Optional[typing.Union[FailureConditions, typing.Dict[builtins.str, typing.Any]]] = None,
9381
+ on_success: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
8822
9382
  transition_disabled_reason: typing.Optional[builtins.str] = None,
8823
9383
  transition_to_enabled: typing.Optional[builtins.bool] = None,
8824
9384
  ) -> IStage:
@@ -8827,6 +9387,9 @@ class Pipeline(
8827
9387
  :param placement:
8828
9388
  :param stage_name: The physical, human-readable name to assign to this Pipeline Stage.
8829
9389
  :param actions: The list of Actions to create this Stage with. You can always add more Actions later by calling ``IStage#addAction``.
9390
+ :param before_entry: The method to use when a stage allows entry. Default: - No conditions are applied before stage entry
9391
+ :param on_failure: The method to use when a stage has not completed successfully. Default: - No failure conditions are applied
9392
+ :param on_success: The method to use when a stage has succeeded. Default: - No success conditions are applied
8830
9393
  :param transition_disabled_reason: The reason for disabling transition to this stage. Only applicable if ``transitionToEnabled`` is set to ``false``. Default: 'Transition disabled'
8831
9394
  :param transition_to_enabled: Whether to enable transition to this stage. Default: true
8832
9395
 
@@ -8836,6 +9399,9 @@ class Pipeline(
8836
9399
  placement=placement,
8837
9400
  stage_name=stage_name,
8838
9401
  actions=actions,
9402
+ before_entry=before_entry,
9403
+ on_failure=on_failure,
9404
+ on_success=on_success,
8839
9405
  transition_disabled_reason=transition_disabled_reason,
8840
9406
  transition_to_enabled=transition_to_enabled,
8841
9407
  )
@@ -9444,35 +10010,35 @@ class PipelineProps:
9444
10010
 
9445
10011
  Example::
9446
10012
 
9447
- # Source action
9448
- bucket = s3.Bucket(self, "SourceBucket",
9449
- versioned=True
9450
- )
9451
- source_artifact = codepipeline.Artifact("SourceArtifact")
9452
- source_action = codepipeline_actions.S3SourceAction(
9453
- action_name="Source",
9454
- output=source_artifact,
9455
- bucket=bucket,
9456
- bucket_key="my.zip"
9457
- )
10013
+ # source_action: codepipeline_actions.S3SourceAction
10014
+ # source_output: codepipeline.Artifact
10015
+ # deploy_bucket: s3.Bucket
9458
10016
 
9459
- # Commands action
9460
- output_artifact = codepipeline.Artifact("OutputArtifact")
9461
- commands_action = codepipeline_actions.CommandsAction(
9462
- action_name="Commands",
9463
- commands=["echo \"some commands\""
9464
- ],
9465
- input=source_artifact,
9466
- output=output_artifact
10017
+
10018
+ # Pipeline-level variable
10019
+ variable = codepipeline.Variable(
10020
+ variable_name="bucket-var",
10021
+ description="description",
10022
+ default_value="sample"
9467
10023
  )
9468
10024
 
9469
- pipeline = codepipeline.Pipeline(self, "Pipeline",
10025
+ codepipeline.Pipeline(self, "Pipeline",
10026
+ pipeline_type=codepipeline.PipelineType.V2,
10027
+ variables=[variable],
9470
10028
  stages=[codepipeline.StageProps(
9471
10029
  stage_name="Source",
9472
10030
  actions=[source_action]
9473
10031
  ), codepipeline.StageProps(
9474
- stage_name="Commands",
9475
- actions=[commands_action]
10032
+ stage_name="Deploy",
10033
+ actions=[
10034
+ codepipeline_actions.S3DeployAction(
10035
+ action_name="DeployAction",
10036
+ # can reference the variables
10037
+ object_key=f"{variable.reference()}.txt",
10038
+ input=source_output,
10039
+ bucket=deploy_bucket
10040
+ )
10041
+ ]
9476
10042
  )
9477
10043
  ]
9478
10044
  )
@@ -9767,54 +10333,514 @@ class ProviderType(enum.Enum):
9767
10333
  '''CodeStarSourceConnection.'''
9768
10334
 
9769
10335
 
9770
- @jsii.data_type(
9771
- jsii_type="aws-cdk-lib.aws_codepipeline.StagePlacement",
9772
- jsii_struct_bases=[],
9773
- name_mapping={"just_after": "justAfter", "right_before": "rightBefore"},
9774
- )
9775
- class StagePlacement:
9776
- def __init__(
9777
- self,
9778
- *,
9779
- just_after: typing.Optional[IStage] = None,
9780
- right_before: typing.Optional[IStage] = None,
9781
- ) -> None:
9782
- '''Allows you to control where to place a new Stage when it's added to the Pipeline.
9783
-
9784
- Note that you can provide only one of the below properties -
9785
- specifying more than one will result in a validation error.
9786
-
9787
- :param just_after: Inserts the new Stage as a child of the given Stage (changing its current child Stage, if it had one).
9788
- :param right_before: Inserts the new Stage as a parent of the given Stage (changing its current parent Stage, if it had one).
10336
+ @jsii.enum(jsii_type="aws-cdk-lib.aws_codepipeline.Result")
10337
+ class Result(enum.Enum):
10338
+ '''The action to be done when the condition is met.
9789
10339
 
9790
- :see: #justAfter
9791
- :exampleMetadata: infused
10340
+ :exampleMetadata: infused
9792
10341
 
9793
- Example::
10342
+ Example::
9794
10343
 
9795
- # Insert a new Stage at an arbitrary point
9796
- # pipeline: codepipeline.Pipeline
9797
- # another_stage: codepipeline.IStage
9798
- # yet_another_stage: codepipeline.IStage
9799
-
9800
-
9801
- some_stage = pipeline.add_stage(
9802
- stage_name="SomeStage",
9803
- placement=codepipeline.StagePlacement(
9804
- # note: you can only specify one of the below properties
9805
- right_before=another_stage,
9806
- just_after=yet_another_stage
9807
- )
9808
- )
9809
- '''
9810
- if __debug__:
9811
- type_hints = typing.get_type_hints(_typecheckingstub__c178aee5c43b367dd6efb72d92b210fe5967b9817ff84698c049986838c0cf39)
9812
- check_type(argname="argument just_after", value=just_after, expected_type=type_hints["just_after"])
9813
- check_type(argname="argument right_before", value=right_before, expected_type=type_hints["right_before"])
9814
- self._values: typing.Dict[builtins.str, typing.Any] = {}
9815
- if just_after is not None:
9816
- self._values["just_after"] = just_after
9817
- if right_before is not None:
10344
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
10345
+ # build_action: codepipeline_actions.CodeBuildAction
10346
+
10347
+
10348
+ codepipeline.Pipeline(self, "Pipeline",
10349
+ pipeline_type=codepipeline.PipelineType.V2,
10350
+ stages=[codepipeline.StageProps(
10351
+ stage_name="Source",
10352
+ actions=[source_action]
10353
+ ), codepipeline.StageProps(
10354
+ stage_name="Build",
10355
+ actions=[build_action],
10356
+ # BeforeEntry condition - checks before entering the stage
10357
+ before_entry=codepipeline.Conditions(
10358
+ conditions=[codepipeline.Condition(
10359
+ rules=[codepipeline.Rule(
10360
+ name="LambdaCheck",
10361
+ provider="LambdaInvoke",
10362
+ version="1",
10363
+ configuration={
10364
+ "FunctionName": "LambdaFunctionName"
10365
+ }
10366
+ )],
10367
+ result=codepipeline.Result.FAIL
10368
+ )]
10369
+ ),
10370
+ # OnSuccess condition - checks after successful stage completion
10371
+ on_success=codepipeline.Conditions(
10372
+ conditions=[codepipeline.Condition(
10373
+ result=codepipeline.Result.FAIL,
10374
+ rules=[codepipeline.Rule(
10375
+ name="CloudWatchCheck",
10376
+ provider="LambdaInvoke",
10377
+ version="1",
10378
+ configuration={
10379
+ "AlarmName": "AlarmName1",
10380
+ "WaitTime": "300", # 5 minutes
10381
+ "FunctionName": "funcName2"
10382
+ }
10383
+ )]
10384
+ )]
10385
+ ),
10386
+ # OnFailure condition - handles stage failure
10387
+ on_failure=codepipeline.FailureConditions(
10388
+ conditions=[codepipeline.Condition(
10389
+ result=codepipeline.Result.ROLLBACK,
10390
+ rules=[codepipeline.Rule(
10391
+ name="RollBackOnFailure",
10392
+ provider="LambdaInvoke",
10393
+ version="1",
10394
+ configuration={
10395
+ "AlarmName": "Alarm",
10396
+ "WaitTime": "300", # 5 minutes
10397
+ "FunctionName": "funcName1"
10398
+ }
10399
+ )]
10400
+ )]
10401
+ )
10402
+ )
10403
+ ]
10404
+ )
10405
+ '''
10406
+
10407
+ ROLLBACK = "ROLLBACK"
10408
+ '''Rollback.'''
10409
+ FAIL = "FAIL"
10410
+ '''Failure.'''
10411
+ RETRY = "RETRY"
10412
+ '''Retry.'''
10413
+ SKIP = "SKIP"
10414
+ '''Skip.'''
10415
+
10416
+
10417
+ @jsii.enum(jsii_type="aws-cdk-lib.aws_codepipeline.RetryMode")
10418
+ class RetryMode(enum.Enum):
10419
+ '''The method that you want to configure for automatic stage retry on stage failure.
10420
+
10421
+ You can specify to retry only failed action in the stage or all actions in the stage.
10422
+ '''
10423
+
10424
+ ALL_ACTIONS = "ALL_ACTIONS"
10425
+ '''Retry all actions under this stage.'''
10426
+ FAILED_ACTIONS = "FAILED_ACTIONS"
10427
+ '''Only retry failed actions.'''
10428
+
10429
+
10430
+ class Rule(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_codepipeline.Rule"):
10431
+ '''Represents a rule in AWS CodePipeline that can be used to add conditions and controls to pipeline execution.
10432
+
10433
+ :exampleMetadata: infused
10434
+
10435
+ Example::
10436
+
10437
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
10438
+ # build_action: codepipeline_actions.CodeBuildAction
10439
+
10440
+
10441
+ codepipeline.Pipeline(self, "Pipeline",
10442
+ pipeline_type=codepipeline.PipelineType.V2,
10443
+ stages=[codepipeline.StageProps(
10444
+ stage_name="Source",
10445
+ actions=[source_action]
10446
+ ), codepipeline.StageProps(
10447
+ stage_name="Build",
10448
+ actions=[build_action],
10449
+ # BeforeEntry condition - checks before entering the stage
10450
+ before_entry=codepipeline.Conditions(
10451
+ conditions=[codepipeline.Condition(
10452
+ rules=[codepipeline.Rule(
10453
+ name="LambdaCheck",
10454
+ provider="LambdaInvoke",
10455
+ version="1",
10456
+ configuration={
10457
+ "FunctionName": "LambdaFunctionName"
10458
+ }
10459
+ )],
10460
+ result=codepipeline.Result.FAIL
10461
+ )]
10462
+ ),
10463
+ # OnSuccess condition - checks after successful stage completion
10464
+ on_success=codepipeline.Conditions(
10465
+ conditions=[codepipeline.Condition(
10466
+ result=codepipeline.Result.FAIL,
10467
+ rules=[codepipeline.Rule(
10468
+ name="CloudWatchCheck",
10469
+ provider="LambdaInvoke",
10470
+ version="1",
10471
+ configuration={
10472
+ "AlarmName": "AlarmName1",
10473
+ "WaitTime": "300", # 5 minutes
10474
+ "FunctionName": "funcName2"
10475
+ }
10476
+ )]
10477
+ )]
10478
+ ),
10479
+ # OnFailure condition - handles stage failure
10480
+ on_failure=codepipeline.FailureConditions(
10481
+ conditions=[codepipeline.Condition(
10482
+ result=codepipeline.Result.ROLLBACK,
10483
+ rules=[codepipeline.Rule(
10484
+ name="RollBackOnFailure",
10485
+ provider="LambdaInvoke",
10486
+ version="1",
10487
+ configuration={
10488
+ "AlarmName": "Alarm",
10489
+ "WaitTime": "300", # 5 minutes
10490
+ "FunctionName": "funcName1"
10491
+ }
10492
+ )]
10493
+ )]
10494
+ )
10495
+ )
10496
+ ]
10497
+ )
10498
+ '''
10499
+
10500
+ def __init__(
10501
+ self,
10502
+ *,
10503
+ commands: typing.Optional[typing.Sequence[builtins.str]] = None,
10504
+ configuration: typing.Optional[typing.Mapping[typing.Any, typing.Any]] = None,
10505
+ input_artifacts: typing.Optional[typing.Sequence[builtins.str]] = None,
10506
+ name: typing.Optional[builtins.str] = None,
10507
+ provider: typing.Optional[builtins.str] = None,
10508
+ region: typing.Optional[builtins.str] = None,
10509
+ role: typing.Optional[_Role_e8c6e11f] = None,
10510
+ version: typing.Optional[builtins.str] = None,
10511
+ ) -> None:
10512
+ '''Creates a new Rule instance.
10513
+
10514
+ :param commands: The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild. Default: - No commands
10515
+ :param configuration: The action configuration fields for the rule. This can include custom parameters specific to the rule type. Default: - No configuration
10516
+ :param input_artifacts: The input artifacts fields for the rule, such as specifying an input file for the rule. Each string in the array represents an artifact name that this rule will use as input. Default: - No input artifacts
10517
+ :param name: The name of the rule that is created for the condition. Must be unique within the pipeline. Default: - A unique name will be generated
10518
+ :param provider: The rule provider that implements the rule's functionality. Default: - No provider, must be specified if rule is used
10519
+ :param region: The AWS Region for the condition associated with the rule. If not specified, uses the pipeline's region. Default: - Pipeline's region
10520
+ :param role: The IAM role that the rule will use to execute its actions. The role must have sufficient permissions to perform the rule's tasks. Default: - A new role will be created
10521
+ :param version: The version of the rule to use. Different versions may have different features or behaviors. Default: '1'
10522
+
10523
+ :throws: {Error} If the rule name is invalid
10524
+ '''
10525
+ props = RuleProps(
10526
+ commands=commands,
10527
+ configuration=configuration,
10528
+ input_artifacts=input_artifacts,
10529
+ name=name,
10530
+ provider=provider,
10531
+ region=region,
10532
+ role=role,
10533
+ version=version,
10534
+ )
10535
+
10536
+ jsii.create(self.__class__, self, [props])
10537
+
10538
+ @jsii.member(jsii_name="reference")
10539
+ def reference(self) -> builtins.str:
10540
+ '''Returns a reference to the rule that can be used in pipeline stage conditions.
10541
+
10542
+ :return: A string in the format "#{rule.ruleName}" that can be used to reference this rule
10543
+ '''
10544
+ return typing.cast(builtins.str, jsii.invoke(self, "reference", []))
10545
+
10546
+ @builtins.property
10547
+ @jsii.member(jsii_name="ruleName")
10548
+ def rule_name(self) -> typing.Optional[builtins.str]:
10549
+ '''The name of the rule, if specified in the properties.'''
10550
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "ruleName"))
10551
+
10552
+
10553
+ @jsii.data_type(
10554
+ jsii_type="aws-cdk-lib.aws_codepipeline.RuleProps",
10555
+ jsii_struct_bases=[],
10556
+ name_mapping={
10557
+ "commands": "commands",
10558
+ "configuration": "configuration",
10559
+ "input_artifacts": "inputArtifacts",
10560
+ "name": "name",
10561
+ "provider": "provider",
10562
+ "region": "region",
10563
+ "role": "role",
10564
+ "version": "version",
10565
+ },
10566
+ )
10567
+ class RuleProps:
10568
+ def __init__(
10569
+ self,
10570
+ *,
10571
+ commands: typing.Optional[typing.Sequence[builtins.str]] = None,
10572
+ configuration: typing.Optional[typing.Mapping[typing.Any, typing.Any]] = None,
10573
+ input_artifacts: typing.Optional[typing.Sequence[builtins.str]] = None,
10574
+ name: typing.Optional[builtins.str] = None,
10575
+ provider: typing.Optional[builtins.str] = None,
10576
+ region: typing.Optional[builtins.str] = None,
10577
+ role: typing.Optional[_Role_e8c6e11f] = None,
10578
+ version: typing.Optional[builtins.str] = None,
10579
+ ) -> None:
10580
+ '''Properties for defining a CodePipeline Rule.
10581
+
10582
+ :param commands: The shell commands to run with your commands rule in CodePipeline. All commands are supported except multi-line formats. While CodeBuild logs and permissions are used, you do not need to create any resources in CodeBuild. Default: - No commands
10583
+ :param configuration: The action configuration fields for the rule. This can include custom parameters specific to the rule type. Default: - No configuration
10584
+ :param input_artifacts: The input artifacts fields for the rule, such as specifying an input file for the rule. Each string in the array represents an artifact name that this rule will use as input. Default: - No input artifacts
10585
+ :param name: The name of the rule that is created for the condition. Must be unique within the pipeline. Default: - A unique name will be generated
10586
+ :param provider: The rule provider that implements the rule's functionality. Default: - No provider, must be specified if rule is used
10587
+ :param region: The AWS Region for the condition associated with the rule. If not specified, uses the pipeline's region. Default: - Pipeline's region
10588
+ :param role: The IAM role that the rule will use to execute its actions. The role must have sufficient permissions to perform the rule's tasks. Default: - A new role will be created
10589
+ :param version: The version of the rule to use. Different versions may have different features or behaviors. Default: '1'
10590
+
10591
+ :exampleMetadata: infused
10592
+
10593
+ Example::
10594
+
10595
+ # source_action: codepipeline_actions.CodeStarConnectionsSourceAction
10596
+ # build_action: codepipeline_actions.CodeBuildAction
10597
+
10598
+
10599
+ codepipeline.Pipeline(self, "Pipeline",
10600
+ pipeline_type=codepipeline.PipelineType.V2,
10601
+ stages=[codepipeline.StageProps(
10602
+ stage_name="Source",
10603
+ actions=[source_action]
10604
+ ), codepipeline.StageProps(
10605
+ stage_name="Build",
10606
+ actions=[build_action],
10607
+ # BeforeEntry condition - checks before entering the stage
10608
+ before_entry=codepipeline.Conditions(
10609
+ conditions=[codepipeline.Condition(
10610
+ rules=[codepipeline.Rule(
10611
+ name="LambdaCheck",
10612
+ provider="LambdaInvoke",
10613
+ version="1",
10614
+ configuration={
10615
+ "FunctionName": "LambdaFunctionName"
10616
+ }
10617
+ )],
10618
+ result=codepipeline.Result.FAIL
10619
+ )]
10620
+ ),
10621
+ # OnSuccess condition - checks after successful stage completion
10622
+ on_success=codepipeline.Conditions(
10623
+ conditions=[codepipeline.Condition(
10624
+ result=codepipeline.Result.FAIL,
10625
+ rules=[codepipeline.Rule(
10626
+ name="CloudWatchCheck",
10627
+ provider="LambdaInvoke",
10628
+ version="1",
10629
+ configuration={
10630
+ "AlarmName": "AlarmName1",
10631
+ "WaitTime": "300", # 5 minutes
10632
+ "FunctionName": "funcName2"
10633
+ }
10634
+ )]
10635
+ )]
10636
+ ),
10637
+ # OnFailure condition - handles stage failure
10638
+ on_failure=codepipeline.FailureConditions(
10639
+ conditions=[codepipeline.Condition(
10640
+ result=codepipeline.Result.ROLLBACK,
10641
+ rules=[codepipeline.Rule(
10642
+ name="RollBackOnFailure",
10643
+ provider="LambdaInvoke",
10644
+ version="1",
10645
+ configuration={
10646
+ "AlarmName": "Alarm",
10647
+ "WaitTime": "300", # 5 minutes
10648
+ "FunctionName": "funcName1"
10649
+ }
10650
+ )]
10651
+ )]
10652
+ )
10653
+ )
10654
+ ]
10655
+ )
10656
+ '''
10657
+ if __debug__:
10658
+ type_hints = typing.get_type_hints(_typecheckingstub__04d67752f5c1682591306a9c0ca45eff53409b418ee518ef81598208bfeca4a0)
10659
+ check_type(argname="argument commands", value=commands, expected_type=type_hints["commands"])
10660
+ check_type(argname="argument configuration", value=configuration, expected_type=type_hints["configuration"])
10661
+ check_type(argname="argument input_artifacts", value=input_artifacts, expected_type=type_hints["input_artifacts"])
10662
+ check_type(argname="argument name", value=name, expected_type=type_hints["name"])
10663
+ check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
10664
+ check_type(argname="argument region", value=region, expected_type=type_hints["region"])
10665
+ check_type(argname="argument role", value=role, expected_type=type_hints["role"])
10666
+ check_type(argname="argument version", value=version, expected_type=type_hints["version"])
10667
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
10668
+ if commands is not None:
10669
+ self._values["commands"] = commands
10670
+ if configuration is not None:
10671
+ self._values["configuration"] = configuration
10672
+ if input_artifacts is not None:
10673
+ self._values["input_artifacts"] = input_artifacts
10674
+ if name is not None:
10675
+ self._values["name"] = name
10676
+ if provider is not None:
10677
+ self._values["provider"] = provider
10678
+ if region is not None:
10679
+ self._values["region"] = region
10680
+ if role is not None:
10681
+ self._values["role"] = role
10682
+ if version is not None:
10683
+ self._values["version"] = version
10684
+
10685
+ @builtins.property
10686
+ def commands(self) -> typing.Optional[typing.List[builtins.str]]:
10687
+ '''The shell commands to run with your commands rule in CodePipeline.
10688
+
10689
+ All commands are supported except multi-line formats. While CodeBuild logs and permissions are used,
10690
+ you do not need to create any resources in CodeBuild.
10691
+
10692
+ :default: - No commands
10693
+
10694
+ :remarks: Using compute time for this action will incur separate charges in AWS CodeBuild.
10695
+ '''
10696
+ result = self._values.get("commands")
10697
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
10698
+
10699
+ @builtins.property
10700
+ def configuration(self) -> typing.Optional[typing.Mapping[typing.Any, typing.Any]]:
10701
+ '''The action configuration fields for the rule.
10702
+
10703
+ This can include custom parameters specific to the rule type.
10704
+
10705
+ :default: - No configuration
10706
+ '''
10707
+ result = self._values.get("configuration")
10708
+ return typing.cast(typing.Optional[typing.Mapping[typing.Any, typing.Any]], result)
10709
+
10710
+ @builtins.property
10711
+ def input_artifacts(self) -> typing.Optional[typing.List[builtins.str]]:
10712
+ '''The input artifacts fields for the rule, such as specifying an input file for the rule.
10713
+
10714
+ Each string in the array represents an artifact name that this rule will use as input.
10715
+
10716
+ :default: - No input artifacts
10717
+ '''
10718
+ result = self._values.get("input_artifacts")
10719
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
10720
+
10721
+ @builtins.property
10722
+ def name(self) -> typing.Optional[builtins.str]:
10723
+ '''The name of the rule that is created for the condition.
10724
+
10725
+ Must be unique within the pipeline.
10726
+
10727
+ :default: - A unique name will be generated
10728
+
10729
+ Example::
10730
+
10731
+ "VariableCheck"
10732
+ '''
10733
+ result = self._values.get("name")
10734
+ return typing.cast(typing.Optional[builtins.str], result)
10735
+
10736
+ @builtins.property
10737
+ def provider(self) -> typing.Optional[builtins.str]:
10738
+ '''The rule provider that implements the rule's functionality.
10739
+
10740
+ :default: - No provider, must be specified if rule is used
10741
+
10742
+ :see: AWS CodePipeline rule reference for available providers
10743
+
10744
+ Example::
10745
+
10746
+ "DeploymentWindow"
10747
+ '''
10748
+ result = self._values.get("provider")
10749
+ return typing.cast(typing.Optional[builtins.str], result)
10750
+
10751
+ @builtins.property
10752
+ def region(self) -> typing.Optional[builtins.str]:
10753
+ '''The AWS Region for the condition associated with the rule.
10754
+
10755
+ If not specified, uses the pipeline's region.
10756
+
10757
+ :default: - Pipeline's region
10758
+ '''
10759
+ result = self._values.get("region")
10760
+ return typing.cast(typing.Optional[builtins.str], result)
10761
+
10762
+ @builtins.property
10763
+ def role(self) -> typing.Optional[_Role_e8c6e11f]:
10764
+ '''The IAM role that the rule will use to execute its actions.
10765
+
10766
+ The role must have sufficient permissions to perform the rule's tasks.
10767
+
10768
+ :default: - A new role will be created
10769
+ '''
10770
+ result = self._values.get("role")
10771
+ return typing.cast(typing.Optional[_Role_e8c6e11f], result)
10772
+
10773
+ @builtins.property
10774
+ def version(self) -> typing.Optional[builtins.str]:
10775
+ '''The version of the rule to use.
10776
+
10777
+ Different versions may have different features or behaviors.
10778
+
10779
+ :default: '1'
10780
+ '''
10781
+ result = self._values.get("version")
10782
+ return typing.cast(typing.Optional[builtins.str], result)
10783
+
10784
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
10785
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
10786
+
10787
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
10788
+ return not (rhs == self)
10789
+
10790
+ def __repr__(self) -> str:
10791
+ return "RuleProps(%s)" % ", ".join(
10792
+ k + "=" + repr(v) for k, v in self._values.items()
10793
+ )
10794
+
10795
+
10796
+ @jsii.data_type(
10797
+ jsii_type="aws-cdk-lib.aws_codepipeline.StagePlacement",
10798
+ jsii_struct_bases=[],
10799
+ name_mapping={"just_after": "justAfter", "right_before": "rightBefore"},
10800
+ )
10801
+ class StagePlacement:
10802
+ def __init__(
10803
+ self,
10804
+ *,
10805
+ just_after: typing.Optional[IStage] = None,
10806
+ right_before: typing.Optional[IStage] = None,
10807
+ ) -> None:
10808
+ '''Allows you to control where to place a new Stage when it's added to the Pipeline.
10809
+
10810
+ Note that you can provide only one of the below properties -
10811
+ specifying more than one will result in a validation error.
10812
+
10813
+ :param just_after: Inserts the new Stage as a child of the given Stage (changing its current child Stage, if it had one).
10814
+ :param right_before: Inserts the new Stage as a parent of the given Stage (changing its current parent Stage, if it had one).
10815
+
10816
+ :see: #justAfter
10817
+ :exampleMetadata: infused
10818
+
10819
+ Example::
10820
+
10821
+ # Insert a new Stage at an arbitrary point
10822
+ # pipeline: codepipeline.Pipeline
10823
+ # another_stage: codepipeline.IStage
10824
+ # yet_another_stage: codepipeline.IStage
10825
+
10826
+
10827
+ some_stage = pipeline.add_stage(
10828
+ stage_name="SomeStage",
10829
+ placement=codepipeline.StagePlacement(
10830
+ # note: you can only specify one of the below properties
10831
+ right_before=another_stage,
10832
+ just_after=yet_another_stage
10833
+ )
10834
+ )
10835
+ '''
10836
+ if __debug__:
10837
+ type_hints = typing.get_type_hints(_typecheckingstub__c178aee5c43b367dd6efb72d92b210fe5967b9817ff84698c049986838c0cf39)
10838
+ check_type(argname="argument just_after", value=just_after, expected_type=type_hints["just_after"])
10839
+ check_type(argname="argument right_before", value=right_before, expected_type=type_hints["right_before"])
10840
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
10841
+ if just_after is not None:
10842
+ self._values["just_after"] = just_after
10843
+ if right_before is not None:
9818
10844
  self._values["right_before"] = right_before
9819
10845
 
9820
10846
  @builtins.property
@@ -9847,6 +10873,9 @@ class StagePlacement:
9847
10873
  name_mapping={
9848
10874
  "stage_name": "stageName",
9849
10875
  "actions": "actions",
10876
+ "before_entry": "beforeEntry",
10877
+ "on_failure": "onFailure",
10878
+ "on_success": "onSuccess",
9850
10879
  "transition_disabled_reason": "transitionDisabledReason",
9851
10880
  "transition_to_enabled": "transitionToEnabled",
9852
10881
  },
@@ -9857,6 +10886,9 @@ class StageProps:
9857
10886
  *,
9858
10887
  stage_name: builtins.str,
9859
10888
  actions: typing.Optional[typing.Sequence[IAction]] = None,
10889
+ before_entry: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
10890
+ on_failure: typing.Optional[typing.Union[FailureConditions, typing.Dict[builtins.str, typing.Any]]] = None,
10891
+ on_success: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
9860
10892
  transition_disabled_reason: typing.Optional[builtins.str] = None,
9861
10893
  transition_to_enabled: typing.Optional[builtins.bool] = None,
9862
10894
  ) -> None:
@@ -9864,6 +10896,9 @@ class StageProps:
9864
10896
 
9865
10897
  :param stage_name: The physical, human-readable name to assign to this Pipeline Stage.
9866
10898
  :param actions: The list of Actions to create this Stage with. You can always add more Actions later by calling ``IStage#addAction``.
10899
+ :param before_entry: The method to use when a stage allows entry. Default: - No conditions are applied before stage entry
10900
+ :param on_failure: The method to use when a stage has not completed successfully. Default: - No failure conditions are applied
10901
+ :param on_success: The method to use when a stage has succeeded. Default: - No success conditions are applied
9867
10902
  :param transition_disabled_reason: The reason for disabling transition to this stage. Only applicable if ``transitionToEnabled`` is set to ``false``. Default: 'Transition disabled'
9868
10903
  :param transition_to_enabled: Whether to enable transition to this stage. Default: true
9869
10904
 
@@ -9876,20 +10911,50 @@ class StageProps:
9876
10911
  from aws_cdk import aws_codepipeline as codepipeline
9877
10912
 
9878
10913
  # action: codepipeline.Action
10914
+ # rule: codepipeline.Rule
9879
10915
 
9880
10916
  stage_props = codepipeline.StageProps(
9881
10917
  stage_name="stageName",
9882
10918
 
9883
10919
  # the properties below are optional
9884
10920
  actions=[action],
10921
+ before_entry=codepipeline.Conditions(
10922
+ conditions=[codepipeline.Condition(
10923
+ result=codepipeline.Result.ROLLBACK,
10924
+ rules=[rule]
10925
+ )]
10926
+ ),
10927
+ on_failure=codepipeline.FailureConditions(
10928
+ conditions=[codepipeline.Condition(
10929
+ result=codepipeline.Result.ROLLBACK,
10930
+ rules=[rule]
10931
+ )],
10932
+ result=codepipeline.Result.ROLLBACK,
10933
+ retry_mode=codepipeline.RetryMode.ALL_ACTIONS
10934
+ ),
10935
+ on_success=codepipeline.Conditions(
10936
+ conditions=[codepipeline.Condition(
10937
+ result=codepipeline.Result.ROLLBACK,
10938
+ rules=[rule]
10939
+ )]
10940
+ ),
9885
10941
  transition_disabled_reason="transitionDisabledReason",
9886
10942
  transition_to_enabled=False
9887
10943
  )
9888
10944
  '''
10945
+ if isinstance(before_entry, dict):
10946
+ before_entry = Conditions(**before_entry)
10947
+ if isinstance(on_failure, dict):
10948
+ on_failure = FailureConditions(**on_failure)
10949
+ if isinstance(on_success, dict):
10950
+ on_success = Conditions(**on_success)
9889
10951
  if __debug__:
9890
10952
  type_hints = typing.get_type_hints(_typecheckingstub__6abc7556098f83ba3d73e92b8d6098aeb43f50e6fc7a58af7d194bb4ffc1f646)
9891
10953
  check_type(argname="argument stage_name", value=stage_name, expected_type=type_hints["stage_name"])
9892
10954
  check_type(argname="argument actions", value=actions, expected_type=type_hints["actions"])
10955
+ check_type(argname="argument before_entry", value=before_entry, expected_type=type_hints["before_entry"])
10956
+ check_type(argname="argument on_failure", value=on_failure, expected_type=type_hints["on_failure"])
10957
+ check_type(argname="argument on_success", value=on_success, expected_type=type_hints["on_success"])
9893
10958
  check_type(argname="argument transition_disabled_reason", value=transition_disabled_reason, expected_type=type_hints["transition_disabled_reason"])
9894
10959
  check_type(argname="argument transition_to_enabled", value=transition_to_enabled, expected_type=type_hints["transition_to_enabled"])
9895
10960
  self._values: typing.Dict[builtins.str, typing.Any] = {
@@ -9897,6 +10962,12 @@ class StageProps:
9897
10962
  }
9898
10963
  if actions is not None:
9899
10964
  self._values["actions"] = actions
10965
+ if before_entry is not None:
10966
+ self._values["before_entry"] = before_entry
10967
+ if on_failure is not None:
10968
+ self._values["on_failure"] = on_failure
10969
+ if on_success is not None:
10970
+ self._values["on_success"] = on_success
9900
10971
  if transition_disabled_reason is not None:
9901
10972
  self._values["transition_disabled_reason"] = transition_disabled_reason
9902
10973
  if transition_to_enabled is not None:
@@ -9918,6 +10989,33 @@ class StageProps:
9918
10989
  result = self._values.get("actions")
9919
10990
  return typing.cast(typing.Optional[typing.List[IAction]], result)
9920
10991
 
10992
+ @builtins.property
10993
+ def before_entry(self) -> typing.Optional[Conditions]:
10994
+ '''The method to use when a stage allows entry.
10995
+
10996
+ :default: - No conditions are applied before stage entry
10997
+ '''
10998
+ result = self._values.get("before_entry")
10999
+ return typing.cast(typing.Optional[Conditions], result)
11000
+
11001
+ @builtins.property
11002
+ def on_failure(self) -> typing.Optional[FailureConditions]:
11003
+ '''The method to use when a stage has not completed successfully.
11004
+
11005
+ :default: - No failure conditions are applied
11006
+ '''
11007
+ result = self._values.get("on_failure")
11008
+ return typing.cast(typing.Optional[FailureConditions], result)
11009
+
11010
+ @builtins.property
11011
+ def on_success(self) -> typing.Optional[Conditions]:
11012
+ '''The method to use when a stage has succeeded.
11013
+
11014
+ :default: - No success conditions are applied
11015
+ '''
11016
+ result = self._values.get("on_success")
11017
+ return typing.cast(typing.Optional[Conditions], result)
11018
+
9921
11019
  @builtins.property
9922
11020
  def transition_disabled_reason(self) -> typing.Optional[builtins.str]:
9923
11021
  '''The reason for disabling transition to this stage.
@@ -9983,6 +11081,10 @@ class Trigger(
9983
11081
  file_paths_includes=["filePathsIncludes"]
9984
11082
  )],
9985
11083
  push_filter=[codepipeline.GitPushFilter(
11084
+ branches_excludes=["branchesExcludes"],
11085
+ branches_includes=["branchesIncludes"],
11086
+ file_paths_excludes=["filePathsExcludes"],
11087
+ file_paths_includes=["filePathsIncludes"],
9986
11088
  tags_excludes=["tagsExcludes"],
9987
11089
  tags_includes=["tagsIncludes"]
9988
11090
  )]
@@ -10455,6 +11557,9 @@ typing.cast(typing.Any, Action).__jsii_proxy_class__ = lambda : _ActionProxy
10455
11557
  name_mapping={
10456
11558
  "stage_name": "stageName",
10457
11559
  "actions": "actions",
11560
+ "before_entry": "beforeEntry",
11561
+ "on_failure": "onFailure",
11562
+ "on_success": "onSuccess",
10458
11563
  "transition_disabled_reason": "transitionDisabledReason",
10459
11564
  "transition_to_enabled": "transitionToEnabled",
10460
11565
  "placement": "placement",
@@ -10466,6 +11571,9 @@ class StageOptions(StageProps):
10466
11571
  *,
10467
11572
  stage_name: builtins.str,
10468
11573
  actions: typing.Optional[typing.Sequence[IAction]] = None,
11574
+ before_entry: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
11575
+ on_failure: typing.Optional[typing.Union[FailureConditions, typing.Dict[builtins.str, typing.Any]]] = None,
11576
+ on_success: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
10469
11577
  transition_disabled_reason: typing.Optional[builtins.str] = None,
10470
11578
  transition_to_enabled: typing.Optional[builtins.bool] = None,
10471
11579
  placement: typing.Optional[typing.Union[StagePlacement, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -10473,6 +11581,9 @@ class StageOptions(StageProps):
10473
11581
  '''
10474
11582
  :param stage_name: The physical, human-readable name to assign to this Pipeline Stage.
10475
11583
  :param actions: The list of Actions to create this Stage with. You can always add more Actions later by calling ``IStage#addAction``.
11584
+ :param before_entry: The method to use when a stage allows entry. Default: - No conditions are applied before stage entry
11585
+ :param on_failure: The method to use when a stage has not completed successfully. Default: - No failure conditions are applied
11586
+ :param on_success: The method to use when a stage has succeeded. Default: - No success conditions are applied
10476
11587
  :param transition_disabled_reason: The reason for disabling transition to this stage. Only applicable if ``transitionToEnabled`` is set to ``false``. Default: 'Transition disabled'
10477
11588
  :param transition_to_enabled: Whether to enable transition to this stage. Default: true
10478
11589
  :param placement:
@@ -10498,12 +11609,21 @@ class StageOptions(StageProps):
10498
11609
  actions=[step_function_action]
10499
11610
  )
10500
11611
  '''
11612
+ if isinstance(before_entry, dict):
11613
+ before_entry = Conditions(**before_entry)
11614
+ if isinstance(on_failure, dict):
11615
+ on_failure = FailureConditions(**on_failure)
11616
+ if isinstance(on_success, dict):
11617
+ on_success = Conditions(**on_success)
10501
11618
  if isinstance(placement, dict):
10502
11619
  placement = StagePlacement(**placement)
10503
11620
  if __debug__:
10504
11621
  type_hints = typing.get_type_hints(_typecheckingstub__92727a684e79c716bbbda8d093b76a8cb689c53237b1b129e655150ce80272df)
10505
11622
  check_type(argname="argument stage_name", value=stage_name, expected_type=type_hints["stage_name"])
10506
11623
  check_type(argname="argument actions", value=actions, expected_type=type_hints["actions"])
11624
+ check_type(argname="argument before_entry", value=before_entry, expected_type=type_hints["before_entry"])
11625
+ check_type(argname="argument on_failure", value=on_failure, expected_type=type_hints["on_failure"])
11626
+ check_type(argname="argument on_success", value=on_success, expected_type=type_hints["on_success"])
10507
11627
  check_type(argname="argument transition_disabled_reason", value=transition_disabled_reason, expected_type=type_hints["transition_disabled_reason"])
10508
11628
  check_type(argname="argument transition_to_enabled", value=transition_to_enabled, expected_type=type_hints["transition_to_enabled"])
10509
11629
  check_type(argname="argument placement", value=placement, expected_type=type_hints["placement"])
@@ -10512,6 +11632,12 @@ class StageOptions(StageProps):
10512
11632
  }
10513
11633
  if actions is not None:
10514
11634
  self._values["actions"] = actions
11635
+ if before_entry is not None:
11636
+ self._values["before_entry"] = before_entry
11637
+ if on_failure is not None:
11638
+ self._values["on_failure"] = on_failure
11639
+ if on_success is not None:
11640
+ self._values["on_success"] = on_success
10515
11641
  if transition_disabled_reason is not None:
10516
11642
  self._values["transition_disabled_reason"] = transition_disabled_reason
10517
11643
  if transition_to_enabled is not None:
@@ -10535,6 +11661,33 @@ class StageOptions(StageProps):
10535
11661
  result = self._values.get("actions")
10536
11662
  return typing.cast(typing.Optional[typing.List[IAction]], result)
10537
11663
 
11664
+ @builtins.property
11665
+ def before_entry(self) -> typing.Optional[Conditions]:
11666
+ '''The method to use when a stage allows entry.
11667
+
11668
+ :default: - No conditions are applied before stage entry
11669
+ '''
11670
+ result = self._values.get("before_entry")
11671
+ return typing.cast(typing.Optional[Conditions], result)
11672
+
11673
+ @builtins.property
11674
+ def on_failure(self) -> typing.Optional[FailureConditions]:
11675
+ '''The method to use when a stage has not completed successfully.
11676
+
11677
+ :default: - No failure conditions are applied
11678
+ '''
11679
+ result = self._values.get("on_failure")
11680
+ return typing.cast(typing.Optional[FailureConditions], result)
11681
+
11682
+ @builtins.property
11683
+ def on_success(self) -> typing.Optional[Conditions]:
11684
+ '''The method to use when a stage has succeeded.
11685
+
11686
+ :default: - No success conditions are applied
11687
+ '''
11688
+ result = self._values.get("on_success")
11689
+ return typing.cast(typing.Optional[Conditions], result)
11690
+
10538
11691
  @builtins.property
10539
11692
  def transition_disabled_reason(self) -> typing.Optional[builtins.str]:
10540
11693
  '''The reason for disabling transition to this stage.
@@ -10590,11 +11743,14 @@ __all__ = [
10590
11743
  "CfnWebhookProps",
10591
11744
  "CommonActionProps",
10592
11745
  "CommonAwsActionProps",
11746
+ "Condition",
11747
+ "Conditions",
10593
11748
  "CrossRegionSupport",
10594
11749
  "CustomActionProperty",
10595
11750
  "CustomActionRegistration",
10596
11751
  "CustomActionRegistrationProps",
10597
11752
  "ExecutionMode",
11753
+ "FailureConditions",
10598
11754
  "GitConfiguration",
10599
11755
  "GitPullRequestEvent",
10600
11756
  "GitPullRequestFilter",
@@ -10609,6 +11765,10 @@ __all__ = [
10609
11765
  "PipelineProps",
10610
11766
  "PipelineType",
10611
11767
  "ProviderType",
11768
+ "Result",
11769
+ "RetryMode",
11770
+ "Rule",
11771
+ "RuleProps",
10612
11772
  "StageOptions",
10613
11773
  "StagePlacement",
10614
11774
  "StageProps",
@@ -11315,6 +12475,21 @@ def _typecheckingstub__b783a63e8d6c7172676968c2e23c558eb0d0f2b7f7bcc22e469d596ee
11315
12475
  """Type checking stubs"""
11316
12476
  pass
11317
12477
 
12478
+ def _typecheckingstub__f9d3d585d6146668bf50fd9ef4e444521a4def40f934c6c42bb219a9816ffc01(
12479
+ *,
12480
+ result: typing.Optional[Result] = None,
12481
+ rules: typing.Optional[typing.Sequence[Rule]] = None,
12482
+ ) -> None:
12483
+ """Type checking stubs"""
12484
+ pass
12485
+
12486
+ def _typecheckingstub__b1d234052e60461c20b06295a40d2efb73b7297f0a204252511a0083c29daef9(
12487
+ *,
12488
+ conditions: typing.Optional[typing.Sequence[typing.Union[Condition, typing.Dict[builtins.str, typing.Any]]]] = None,
12489
+ ) -> None:
12490
+ """Type checking stubs"""
12491
+ pass
12492
+
11318
12493
  def _typecheckingstub__d001dfd3e83aa31d0adf70e4d5aba4e4d34063bfb876bb5ad39b788c9e458e0c(
11319
12494
  *,
11320
12495
  replication_bucket: _IBucket_42e086fd,
@@ -11364,6 +12539,15 @@ def _typecheckingstub__65e227e2024e22ec4a8340ba1d5e7057772fcde85f4031d00361f79aa
11364
12539
  """Type checking stubs"""
11365
12540
  pass
11366
12541
 
12542
+ def _typecheckingstub__5c4e44cde413d4a9db86d96fc9c455622d0585f9fb8a399e230a3e6f73163569(
12543
+ *,
12544
+ conditions: typing.Optional[typing.Sequence[typing.Union[Condition, typing.Dict[builtins.str, typing.Any]]]] = None,
12545
+ result: typing.Optional[Result] = None,
12546
+ retry_mode: typing.Optional[RetryMode] = None,
12547
+ ) -> None:
12548
+ """Type checking stubs"""
12549
+ pass
12550
+
11367
12551
  def _typecheckingstub__9bf0379bb3fa72f7dc00a45de6a383d19d18294c73d73dabcbdb7240e76832bf(
11368
12552
  *,
11369
12553
  source_action: IAction,
@@ -11386,6 +12570,10 @@ def _typecheckingstub__cd84a4c10c68eec597c7c17a163a758ee28d398b585c996c44eba7fd9
11386
12570
 
11387
12571
  def _typecheckingstub__d2e5e6ae139c810aa752b8a8c7cd3040d883f9f3a67c8d3693f9ab842351804e(
11388
12572
  *,
12573
+ branches_excludes: typing.Optional[typing.Sequence[builtins.str]] = None,
12574
+ branches_includes: typing.Optional[typing.Sequence[builtins.str]] = None,
12575
+ file_paths_excludes: typing.Optional[typing.Sequence[builtins.str]] = None,
12576
+ file_paths_includes: typing.Optional[typing.Sequence[builtins.str]] = None,
11389
12577
  tags_excludes: typing.Optional[typing.Sequence[builtins.str]] = None,
11390
12578
  tags_includes: typing.Optional[typing.Sequence[builtins.str]] = None,
11391
12579
  ) -> None:
@@ -11693,6 +12881,20 @@ def _typecheckingstub__22f00fc379808105702c3f59369205afd36025a51e45bcaf5d1cec0a3
11693
12881
  """Type checking stubs"""
11694
12882
  pass
11695
12883
 
12884
+ def _typecheckingstub__04d67752f5c1682591306a9c0ca45eff53409b418ee518ef81598208bfeca4a0(
12885
+ *,
12886
+ commands: typing.Optional[typing.Sequence[builtins.str]] = None,
12887
+ configuration: typing.Optional[typing.Mapping[typing.Any, typing.Any]] = None,
12888
+ input_artifacts: typing.Optional[typing.Sequence[builtins.str]] = None,
12889
+ name: typing.Optional[builtins.str] = None,
12890
+ provider: typing.Optional[builtins.str] = None,
12891
+ region: typing.Optional[builtins.str] = None,
12892
+ role: typing.Optional[_Role_e8c6e11f] = None,
12893
+ version: typing.Optional[builtins.str] = None,
12894
+ ) -> None:
12895
+ """Type checking stubs"""
12896
+ pass
12897
+
11696
12898
  def _typecheckingstub__c178aee5c43b367dd6efb72d92b210fe5967b9817ff84698c049986838c0cf39(
11697
12899
  *,
11698
12900
  just_after: typing.Optional[IStage] = None,
@@ -11705,6 +12907,9 @@ def _typecheckingstub__6abc7556098f83ba3d73e92b8d6098aeb43f50e6fc7a58af7d194bb4f
11705
12907
  *,
11706
12908
  stage_name: builtins.str,
11707
12909
  actions: typing.Optional[typing.Sequence[IAction]] = None,
12910
+ before_entry: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
12911
+ on_failure: typing.Optional[typing.Union[FailureConditions, typing.Dict[builtins.str, typing.Any]]] = None,
12912
+ on_success: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
11708
12913
  transition_disabled_reason: typing.Optional[builtins.str] = None,
11709
12914
  transition_to_enabled: typing.Optional[builtins.bool] = None,
11710
12915
  ) -> None:
@@ -11774,6 +12979,9 @@ def _typecheckingstub__92727a684e79c716bbbda8d093b76a8cb689c53237b1b129e655150ce
11774
12979
  *,
11775
12980
  stage_name: builtins.str,
11776
12981
  actions: typing.Optional[typing.Sequence[IAction]] = None,
12982
+ before_entry: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
12983
+ on_failure: typing.Optional[typing.Union[FailureConditions, typing.Dict[builtins.str, typing.Any]]] = None,
12984
+ on_success: typing.Optional[typing.Union[Conditions, typing.Dict[builtins.str, typing.Any]]] = None,
11777
12985
  transition_disabled_reason: typing.Optional[builtins.str] = None,
11778
12986
  transition_to_enabled: typing.Optional[builtins.bool] = None,
11779
12987
  placement: typing.Optional[typing.Union[StagePlacement, typing.Dict[builtins.str, typing.Any]]] = None,