Skip to content
v2.278.0

RuleDeclarationProperty Struct ​

Represents information about the rule to be created for an associated condition.

An example would be creating a new rule for an entry condition, such as a rule that checks for a test result before allowing the run to enter the deployment stage. For more information about conditions, see Stage conditions and How do stage conditions work? . For more information about rules, see the AWS CodePipeline rule reference .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codepipeline as codepipeline } from 'aws-cdk-lib';

declare const configuration: any;
const ruleDeclarationProperty: codepipeline.CfnPipeline.RuleDeclarationProperty = {
  commands: ['commands'],
  configuration: configuration,
  inputArtifacts: [{
    name: 'name',
  }],
  name: 'name',
  region: 'region',
  roleArn: 'roleArn',
  ruleTypeId: {
    category: 'category',
    owner: 'owner',
    provider: 'provider',
    version: 'version',
  },
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codepipeline as codepipeline

# configuration: Any

rule_declaration_property = codepipeline.CfnPipeline.RuleDeclarationProperty(
    commands=["commands"],
    configuration=configuration,
    input_artifacts=[codepipeline.CfnPipeline.InputArtifactProperty(
        name="name"
    )],
    name="name",
    region="region",
    role_arn="roleArn",
    rule_type_id=codepipeline.CfnPipeline.RuleTypeIdProperty(
        category="category",
        owner="owner",
        provider="provider",
        version="version"
    )
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codepipeline.*;

Object configuration;

RuleDeclarationProperty ruleDeclarationProperty = RuleDeclarationProperty.builder()
        .commands(List.of("commands"))
        .configuration(configuration)
        .inputArtifacts(List.of(InputArtifactProperty.builder()
                .name("name")
                .build()))
        .name("name")
        .region("region")
        .roleArn("roleArn")
        .ruleTypeId(RuleTypeIdProperty.builder()
                .category("category")
                .owner("owner")
                .provider("provider")
                .version("version")
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodePipeline;

var configuration;

var ruleDeclarationProperty = new RuleDeclarationProperty {
    Commands = new [] { "commands" },
    Configuration = configuration,
    InputArtifacts = new [] { new InputArtifactProperty {
        Name = "name"
    } },
    Name = "name",
    Region = "region",
    RoleArn = "roleArn",
    RuleTypeId = new RuleTypeIdProperty {
        Category = "category",
        Owner = "owner",
        Provider = "provider",
        Version = "version"
    }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var configuration interface{}

ruleDeclarationProperty := &RuleDeclarationProperty{
	Commands: []*string{
		jsii.String("commands"),
	},
	Configuration: configuration,
	InputArtifacts: []interface{}{
		&InputArtifactProperty{
			Name: jsii.String("name"),
		},
	},
	Name: jsii.String("name"),
	Region: jsii.String("region"),
	RoleArn: jsii.String("roleArn"),
	RuleTypeId: &RuleTypeIdProperty{
		Category: jsii.String("category"),
		Owner: jsii.String("owner"),
		Provider: jsii.String("provider"),
		Version: jsii.String("version"),
	},
}

Properties ​

commandsoptionalstring[]commandsoptionaltyping.List[str]commandsoptionalList<String>Commandsoptionalstring[]Commandsoptional*[]*string #
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.

Using compute time for this action will incur separate charges in AWS CodeBuild .

configurationoptionalanyconfigurationoptionalAnyconfigurationoptionalObjectConfigurationoptionalobjectConfigurationoptionalinterface{} #
The action configuration fields for the rule.
inputArtifactsoptionalIResolvable | IResolvable | CfnPipeline.InputArtifactProperty[]input_artifactsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, InputArtifactProperty]]]inputArtifactsoptionalIResolvableInputArtifactsoptionalIResolvableInputArtifactsoptionalinterface{} #
The input artifacts fields for the rule, such as specifying an input file for the rule.
nameoptionalstringnameoptionalstrnameoptionalStringNameoptionalstringNameoptional*string #
The name of the rule that is created for the condition, such as `VariableCheck` .
regionoptionalstringregionoptionalstrregionoptionalStringRegionoptionalstringRegionoptional*string #
The Region for the condition associated with the rule.
roleArnoptionalstringrole_arnoptionalstrroleArnoptionalStringRoleArnoptionalstringRoleArnoptional*string #
The pipeline role ARN associated with the rule.
ruleTypeIdoptionalIResolvable | CfnPipeline.RuleTypeIdPropertyrule_type_idoptionaltyping.Union[IResolvable, RuleTypeIdProperty]ruleTypeIdoptionalIResolvableRuleTypeIdoptionalIResolvableRuleTypeIdoptionalinterface{} #
The ID for the rule type, which is made up of the combined values for category, owner, provider, and version.