github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codepipeline/pipeline.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package codepipeline
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a CodePipeline.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"fmt"
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codepipeline"
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codestarconnections"
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    30  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
    31  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
    32  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    33  //
    34  // )
    35  //
    36  //	func main() {
    37  //		pulumi.Run(func(ctx *pulumi.Context) error {
    38  //			example, err := codestarconnections.NewConnection(ctx, "example", &codestarconnections.ConnectionArgs{
    39  //				Name:         pulumi.String("example-connection"),
    40  //				ProviderType: pulumi.String("GitHub"),
    41  //			})
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			codepipelineBucket, err := s3.NewBucketV2(ctx, "codepipeline_bucket", &s3.BucketV2Args{
    46  //				Bucket: pulumi.String("test-bucket"),
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
    52  //				Statements: []iam.GetPolicyDocumentStatement{
    53  //					{
    54  //						Effect: pulumi.StringRef("Allow"),
    55  //						Principals: []iam.GetPolicyDocumentStatementPrincipal{
    56  //							{
    57  //								Type: "Service",
    58  //								Identifiers: []string{
    59  //									"codepipeline.amazonaws.com",
    60  //								},
    61  //							},
    62  //						},
    63  //						Actions: []string{
    64  //							"sts:AssumeRole",
    65  //						},
    66  //					},
    67  //				},
    68  //			}, nil)
    69  //			if err != nil {
    70  //				return err
    71  //			}
    72  //			codepipelineRole, err := iam.NewRole(ctx, "codepipeline_role", &iam.RoleArgs{
    73  //				Name:             pulumi.String("test-role"),
    74  //				AssumeRolePolicy: pulumi.String(assumeRole.Json),
    75  //			})
    76  //			if err != nil {
    77  //				return err
    78  //			}
    79  //			s3kmskey, err := kms.LookupAlias(ctx, &kms.LookupAliasArgs{
    80  //				Name: "alias/myKmsKey",
    81  //			}, nil)
    82  //			if err != nil {
    83  //				return err
    84  //			}
    85  //			_, err = codepipeline.NewPipeline(ctx, "codepipeline", &codepipeline.PipelineArgs{
    86  //				Name:    pulumi.String("tf-test-pipeline"),
    87  //				RoleArn: codepipelineRole.Arn,
    88  //				ArtifactStores: codepipeline.PipelineArtifactStoreArray{
    89  //					&codepipeline.PipelineArtifactStoreArgs{
    90  //						Location: codepipelineBucket.Bucket,
    91  //						Type:     pulumi.String("S3"),
    92  //						EncryptionKey: &codepipeline.PipelineArtifactStoreEncryptionKeyArgs{
    93  //							Id:   pulumi.String(s3kmskey.Arn),
    94  //							Type: pulumi.String("KMS"),
    95  //						},
    96  //					},
    97  //				},
    98  //				Stages: codepipeline.PipelineStageArray{
    99  //					&codepipeline.PipelineStageArgs{
   100  //						Name: pulumi.String("Source"),
   101  //						Actions: codepipeline.PipelineStageActionArray{
   102  //							&codepipeline.PipelineStageActionArgs{
   103  //								Name:     pulumi.String("Source"),
   104  //								Category: pulumi.String("Source"),
   105  //								Owner:    pulumi.String("AWS"),
   106  //								Provider: pulumi.String("CodeStarSourceConnection"),
   107  //								Version:  pulumi.String("1"),
   108  //								OutputArtifacts: pulumi.StringArray{
   109  //									pulumi.String("source_output"),
   110  //								},
   111  //								Configuration: pulumi.StringMap{
   112  //									"ConnectionArn":    example.Arn,
   113  //									"FullRepositoryId": pulumi.String("my-organization/example"),
   114  //									"BranchName":       pulumi.String("main"),
   115  //								},
   116  //							},
   117  //						},
   118  //					},
   119  //					&codepipeline.PipelineStageArgs{
   120  //						Name: pulumi.String("Build"),
   121  //						Actions: codepipeline.PipelineStageActionArray{
   122  //							&codepipeline.PipelineStageActionArgs{
   123  //								Name:     pulumi.String("Build"),
   124  //								Category: pulumi.String("Build"),
   125  //								Owner:    pulumi.String("AWS"),
   126  //								Provider: pulumi.String("CodeBuild"),
   127  //								InputArtifacts: pulumi.StringArray{
   128  //									pulumi.String("source_output"),
   129  //								},
   130  //								OutputArtifacts: pulumi.StringArray{
   131  //									pulumi.String("build_output"),
   132  //								},
   133  //								Version: pulumi.String("1"),
   134  //								Configuration: pulumi.StringMap{
   135  //									"ProjectName": pulumi.String("test"),
   136  //								},
   137  //							},
   138  //						},
   139  //					},
   140  //					&codepipeline.PipelineStageArgs{
   141  //						Name: pulumi.String("Deploy"),
   142  //						Actions: codepipeline.PipelineStageActionArray{
   143  //							&codepipeline.PipelineStageActionArgs{
   144  //								Name:     pulumi.String("Deploy"),
   145  //								Category: pulumi.String("Deploy"),
   146  //								Owner:    pulumi.String("AWS"),
   147  //								Provider: pulumi.String("CloudFormation"),
   148  //								InputArtifacts: pulumi.StringArray{
   149  //									pulumi.String("build_output"),
   150  //								},
   151  //								Version: pulumi.String("1"),
   152  //								Configuration: pulumi.StringMap{
   153  //									"ActionMode":     pulumi.String("REPLACE_ON_FAILURE"),
   154  //									"Capabilities":   pulumi.String("CAPABILITY_AUTO_EXPAND,CAPABILITY_IAM"),
   155  //									"OutputFileName": pulumi.String("CreateStackOutput.json"),
   156  //									"StackName":      pulumi.String("MyStack"),
   157  //									"TemplatePath":   pulumi.String("build_output::sam-templated.yaml"),
   158  //								},
   159  //							},
   160  //						},
   161  //					},
   162  //				},
   163  //			})
   164  //			if err != nil {
   165  //				return err
   166  //			}
   167  //			_, err = s3.NewBucketPublicAccessBlock(ctx, "codepipeline_bucket_pab", &s3.BucketPublicAccessBlockArgs{
   168  //				Bucket:                codepipelineBucket.ID(),
   169  //				BlockPublicAcls:       pulumi.Bool(true),
   170  //				BlockPublicPolicy:     pulumi.Bool(true),
   171  //				IgnorePublicAcls:      pulumi.Bool(true),
   172  //				RestrictPublicBuckets: pulumi.Bool(true),
   173  //			})
   174  //			if err != nil {
   175  //				return err
   176  //			}
   177  //			codepipelinePolicy := iam.GetPolicyDocumentOutput(ctx, iam.GetPolicyDocumentOutputArgs{
   178  //				Statements: iam.GetPolicyDocumentStatementArray{
   179  //					&iam.GetPolicyDocumentStatementArgs{
   180  //						Effect: pulumi.String("Allow"),
   181  //						Actions: pulumi.StringArray{
   182  //							pulumi.String("s3:GetObject"),
   183  //							pulumi.String("s3:GetObjectVersion"),
   184  //							pulumi.String("s3:GetBucketVersioning"),
   185  //							pulumi.String("s3:PutObjectAcl"),
   186  //							pulumi.String("s3:PutObject"),
   187  //						},
   188  //						Resources: pulumi.StringArray{
   189  //							codepipelineBucket.Arn,
   190  //							codepipelineBucket.Arn.ApplyT(func(arn string) (string, error) {
   191  //								return fmt.Sprintf("%v/*", arn), nil
   192  //							}).(pulumi.StringOutput),
   193  //						},
   194  //					},
   195  //					&iam.GetPolicyDocumentStatementArgs{
   196  //						Effect: pulumi.String("Allow"),
   197  //						Actions: pulumi.StringArray{
   198  //							pulumi.String("codestar-connections:UseConnection"),
   199  //						},
   200  //						Resources: pulumi.StringArray{
   201  //							example.Arn,
   202  //						},
   203  //					},
   204  //					&iam.GetPolicyDocumentStatementArgs{
   205  //						Effect: pulumi.String("Allow"),
   206  //						Actions: pulumi.StringArray{
   207  //							pulumi.String("codebuild:BatchGetBuilds"),
   208  //							pulumi.String("codebuild:StartBuild"),
   209  //						},
   210  //						Resources: pulumi.StringArray{
   211  //							pulumi.String("*"),
   212  //						},
   213  //					},
   214  //				},
   215  //			}, nil)
   216  //			_, err = iam.NewRolePolicy(ctx, "codepipeline_policy", &iam.RolePolicyArgs{
   217  //				Name: pulumi.String("codepipeline_policy"),
   218  //				Role: codepipelineRole.ID(),
   219  //				Policy: codepipelinePolicy.ApplyT(func(codepipelinePolicy iam.GetPolicyDocumentResult) (*string, error) {
   220  //					return &codepipelinePolicy.Json, nil
   221  //				}).(pulumi.StringPtrOutput),
   222  //			})
   223  //			if err != nil {
   224  //				return err
   225  //			}
   226  //			return nil
   227  //		})
   228  //	}
   229  //
   230  // ```
   231  // <!--End PulumiCodeChooser -->
   232  //
   233  // ## Import
   234  //
   235  // Using `pulumi import`, import CodePipelines using the name. For example:
   236  //
   237  // ```sh
   238  // $ pulumi import aws:codepipeline/pipeline:Pipeline foo example
   239  // ```
   240  type Pipeline struct {
   241  	pulumi.CustomResourceState
   242  
   243  	// The codepipeline ARN.
   244  	Arn pulumi.StringOutput `pulumi:"arn"`
   245  	// One or more artifactStore blocks. Artifact stores are documented below.
   246  	ArtifactStores PipelineArtifactStoreArrayOutput `pulumi:"artifactStores"`
   247  	// The method that the pipeline will use to handle multiple executions. The default mode is `SUPERSEDED`. For value values, refer to the [AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PipelineDeclaration.html#CodePipeline-Type-PipelineDeclaration-executionMode).
   248  	//
   249  	// **Note:** `QUEUED` or `PARALLEL` mode can only be used with V2 pipelines.
   250  	ExecutionMode pulumi.StringPtrOutput `pulumi:"executionMode"`
   251  	// The name of the pipeline.
   252  	Name pulumi.StringOutput `pulumi:"name"`
   253  	// Type of the pipeline. Possible values are: `V1` and `V2`. Default value is `V1`.
   254  	PipelineType pulumi.StringPtrOutput `pulumi:"pipelineType"`
   255  	// A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
   256  	RoleArn pulumi.StringOutput `pulumi:"roleArn"`
   257  	// A stage block. Stages are documented below.
   258  	Stages PipelineStageArrayOutput `pulumi:"stages"`
   259  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   260  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   261  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   262  	//
   263  	// Deprecated: Please use `tags` instead.
   264  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   265  	// A trigger block. Valid only when `pipelineType` is `V2`. Triggers are documented below.
   266  	Triggers PipelineTriggerArrayOutput `pulumi:"triggers"`
   267  	// A pipeline-level variable block. Valid only when `pipelineType` is `V2`. Variable are documented below.
   268  	Variables PipelineVariableArrayOutput `pulumi:"variables"`
   269  }
   270  
   271  // NewPipeline registers a new resource with the given unique name, arguments, and options.
   272  func NewPipeline(ctx *pulumi.Context,
   273  	name string, args *PipelineArgs, opts ...pulumi.ResourceOption) (*Pipeline, error) {
   274  	if args == nil {
   275  		return nil, errors.New("missing one or more required arguments")
   276  	}
   277  
   278  	if args.ArtifactStores == nil {
   279  		return nil, errors.New("invalid value for required argument 'ArtifactStores'")
   280  	}
   281  	if args.RoleArn == nil {
   282  		return nil, errors.New("invalid value for required argument 'RoleArn'")
   283  	}
   284  	if args.Stages == nil {
   285  		return nil, errors.New("invalid value for required argument 'Stages'")
   286  	}
   287  	opts = internal.PkgResourceDefaultOpts(opts)
   288  	var resource Pipeline
   289  	err := ctx.RegisterResource("aws:codepipeline/pipeline:Pipeline", name, args, &resource, opts...)
   290  	if err != nil {
   291  		return nil, err
   292  	}
   293  	return &resource, nil
   294  }
   295  
   296  // GetPipeline gets an existing Pipeline resource's state with the given name, ID, and optional
   297  // state properties that are used to uniquely qualify the lookup (nil if not required).
   298  func GetPipeline(ctx *pulumi.Context,
   299  	name string, id pulumi.IDInput, state *PipelineState, opts ...pulumi.ResourceOption) (*Pipeline, error) {
   300  	var resource Pipeline
   301  	err := ctx.ReadResource("aws:codepipeline/pipeline:Pipeline", name, id, state, &resource, opts...)
   302  	if err != nil {
   303  		return nil, err
   304  	}
   305  	return &resource, nil
   306  }
   307  
   308  // Input properties used for looking up and filtering Pipeline resources.
   309  type pipelineState struct {
   310  	// The codepipeline ARN.
   311  	Arn *string `pulumi:"arn"`
   312  	// One or more artifactStore blocks. Artifact stores are documented below.
   313  	ArtifactStores []PipelineArtifactStore `pulumi:"artifactStores"`
   314  	// The method that the pipeline will use to handle multiple executions. The default mode is `SUPERSEDED`. For value values, refer to the [AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PipelineDeclaration.html#CodePipeline-Type-PipelineDeclaration-executionMode).
   315  	//
   316  	// **Note:** `QUEUED` or `PARALLEL` mode can only be used with V2 pipelines.
   317  	ExecutionMode *string `pulumi:"executionMode"`
   318  	// The name of the pipeline.
   319  	Name *string `pulumi:"name"`
   320  	// Type of the pipeline. Possible values are: `V1` and `V2`. Default value is `V1`.
   321  	PipelineType *string `pulumi:"pipelineType"`
   322  	// A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
   323  	RoleArn *string `pulumi:"roleArn"`
   324  	// A stage block. Stages are documented below.
   325  	Stages []PipelineStage `pulumi:"stages"`
   326  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   327  	Tags map[string]string `pulumi:"tags"`
   328  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   329  	//
   330  	// Deprecated: Please use `tags` instead.
   331  	TagsAll map[string]string `pulumi:"tagsAll"`
   332  	// A trigger block. Valid only when `pipelineType` is `V2`. Triggers are documented below.
   333  	Triggers []PipelineTrigger `pulumi:"triggers"`
   334  	// A pipeline-level variable block. Valid only when `pipelineType` is `V2`. Variable are documented below.
   335  	Variables []PipelineVariable `pulumi:"variables"`
   336  }
   337  
   338  type PipelineState struct {
   339  	// The codepipeline ARN.
   340  	Arn pulumi.StringPtrInput
   341  	// One or more artifactStore blocks. Artifact stores are documented below.
   342  	ArtifactStores PipelineArtifactStoreArrayInput
   343  	// The method that the pipeline will use to handle multiple executions. The default mode is `SUPERSEDED`. For value values, refer to the [AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PipelineDeclaration.html#CodePipeline-Type-PipelineDeclaration-executionMode).
   344  	//
   345  	// **Note:** `QUEUED` or `PARALLEL` mode can only be used with V2 pipelines.
   346  	ExecutionMode pulumi.StringPtrInput
   347  	// The name of the pipeline.
   348  	Name pulumi.StringPtrInput
   349  	// Type of the pipeline. Possible values are: `V1` and `V2`. Default value is `V1`.
   350  	PipelineType pulumi.StringPtrInput
   351  	// A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
   352  	RoleArn pulumi.StringPtrInput
   353  	// A stage block. Stages are documented below.
   354  	Stages PipelineStageArrayInput
   355  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   356  	Tags pulumi.StringMapInput
   357  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   358  	//
   359  	// Deprecated: Please use `tags` instead.
   360  	TagsAll pulumi.StringMapInput
   361  	// A trigger block. Valid only when `pipelineType` is `V2`. Triggers are documented below.
   362  	Triggers PipelineTriggerArrayInput
   363  	// A pipeline-level variable block. Valid only when `pipelineType` is `V2`. Variable are documented below.
   364  	Variables PipelineVariableArrayInput
   365  }
   366  
   367  func (PipelineState) ElementType() reflect.Type {
   368  	return reflect.TypeOf((*pipelineState)(nil)).Elem()
   369  }
   370  
   371  type pipelineArgs struct {
   372  	// One or more artifactStore blocks. Artifact stores are documented below.
   373  	ArtifactStores []PipelineArtifactStore `pulumi:"artifactStores"`
   374  	// The method that the pipeline will use to handle multiple executions. The default mode is `SUPERSEDED`. For value values, refer to the [AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PipelineDeclaration.html#CodePipeline-Type-PipelineDeclaration-executionMode).
   375  	//
   376  	// **Note:** `QUEUED` or `PARALLEL` mode can only be used with V2 pipelines.
   377  	ExecutionMode *string `pulumi:"executionMode"`
   378  	// The name of the pipeline.
   379  	Name *string `pulumi:"name"`
   380  	// Type of the pipeline. Possible values are: `V1` and `V2`. Default value is `V1`.
   381  	PipelineType *string `pulumi:"pipelineType"`
   382  	// A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
   383  	RoleArn string `pulumi:"roleArn"`
   384  	// A stage block. Stages are documented below.
   385  	Stages []PipelineStage `pulumi:"stages"`
   386  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   387  	Tags map[string]string `pulumi:"tags"`
   388  	// A trigger block. Valid only when `pipelineType` is `V2`. Triggers are documented below.
   389  	Triggers []PipelineTrigger `pulumi:"triggers"`
   390  	// A pipeline-level variable block. Valid only when `pipelineType` is `V2`. Variable are documented below.
   391  	Variables []PipelineVariable `pulumi:"variables"`
   392  }
   393  
   394  // The set of arguments for constructing a Pipeline resource.
   395  type PipelineArgs struct {
   396  	// One or more artifactStore blocks. Artifact stores are documented below.
   397  	ArtifactStores PipelineArtifactStoreArrayInput
   398  	// The method that the pipeline will use to handle multiple executions. The default mode is `SUPERSEDED`. For value values, refer to the [AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PipelineDeclaration.html#CodePipeline-Type-PipelineDeclaration-executionMode).
   399  	//
   400  	// **Note:** `QUEUED` or `PARALLEL` mode can only be used with V2 pipelines.
   401  	ExecutionMode pulumi.StringPtrInput
   402  	// The name of the pipeline.
   403  	Name pulumi.StringPtrInput
   404  	// Type of the pipeline. Possible values are: `V1` and `V2`. Default value is `V1`.
   405  	PipelineType pulumi.StringPtrInput
   406  	// A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
   407  	RoleArn pulumi.StringInput
   408  	// A stage block. Stages are documented below.
   409  	Stages PipelineStageArrayInput
   410  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   411  	Tags pulumi.StringMapInput
   412  	// A trigger block. Valid only when `pipelineType` is `V2`. Triggers are documented below.
   413  	Triggers PipelineTriggerArrayInput
   414  	// A pipeline-level variable block. Valid only when `pipelineType` is `V2`. Variable are documented below.
   415  	Variables PipelineVariableArrayInput
   416  }
   417  
   418  func (PipelineArgs) ElementType() reflect.Type {
   419  	return reflect.TypeOf((*pipelineArgs)(nil)).Elem()
   420  }
   421  
   422  type PipelineInput interface {
   423  	pulumi.Input
   424  
   425  	ToPipelineOutput() PipelineOutput
   426  	ToPipelineOutputWithContext(ctx context.Context) PipelineOutput
   427  }
   428  
   429  func (*Pipeline) ElementType() reflect.Type {
   430  	return reflect.TypeOf((**Pipeline)(nil)).Elem()
   431  }
   432  
   433  func (i *Pipeline) ToPipelineOutput() PipelineOutput {
   434  	return i.ToPipelineOutputWithContext(context.Background())
   435  }
   436  
   437  func (i *Pipeline) ToPipelineOutputWithContext(ctx context.Context) PipelineOutput {
   438  	return pulumi.ToOutputWithContext(ctx, i).(PipelineOutput)
   439  }
   440  
   441  // PipelineArrayInput is an input type that accepts PipelineArray and PipelineArrayOutput values.
   442  // You can construct a concrete instance of `PipelineArrayInput` via:
   443  //
   444  //	PipelineArray{ PipelineArgs{...} }
   445  type PipelineArrayInput interface {
   446  	pulumi.Input
   447  
   448  	ToPipelineArrayOutput() PipelineArrayOutput
   449  	ToPipelineArrayOutputWithContext(context.Context) PipelineArrayOutput
   450  }
   451  
   452  type PipelineArray []PipelineInput
   453  
   454  func (PipelineArray) ElementType() reflect.Type {
   455  	return reflect.TypeOf((*[]*Pipeline)(nil)).Elem()
   456  }
   457  
   458  func (i PipelineArray) ToPipelineArrayOutput() PipelineArrayOutput {
   459  	return i.ToPipelineArrayOutputWithContext(context.Background())
   460  }
   461  
   462  func (i PipelineArray) ToPipelineArrayOutputWithContext(ctx context.Context) PipelineArrayOutput {
   463  	return pulumi.ToOutputWithContext(ctx, i).(PipelineArrayOutput)
   464  }
   465  
   466  // PipelineMapInput is an input type that accepts PipelineMap and PipelineMapOutput values.
   467  // You can construct a concrete instance of `PipelineMapInput` via:
   468  //
   469  //	PipelineMap{ "key": PipelineArgs{...} }
   470  type PipelineMapInput interface {
   471  	pulumi.Input
   472  
   473  	ToPipelineMapOutput() PipelineMapOutput
   474  	ToPipelineMapOutputWithContext(context.Context) PipelineMapOutput
   475  }
   476  
   477  type PipelineMap map[string]PipelineInput
   478  
   479  func (PipelineMap) ElementType() reflect.Type {
   480  	return reflect.TypeOf((*map[string]*Pipeline)(nil)).Elem()
   481  }
   482  
   483  func (i PipelineMap) ToPipelineMapOutput() PipelineMapOutput {
   484  	return i.ToPipelineMapOutputWithContext(context.Background())
   485  }
   486  
   487  func (i PipelineMap) ToPipelineMapOutputWithContext(ctx context.Context) PipelineMapOutput {
   488  	return pulumi.ToOutputWithContext(ctx, i).(PipelineMapOutput)
   489  }
   490  
   491  type PipelineOutput struct{ *pulumi.OutputState }
   492  
   493  func (PipelineOutput) ElementType() reflect.Type {
   494  	return reflect.TypeOf((**Pipeline)(nil)).Elem()
   495  }
   496  
   497  func (o PipelineOutput) ToPipelineOutput() PipelineOutput {
   498  	return o
   499  }
   500  
   501  func (o PipelineOutput) ToPipelineOutputWithContext(ctx context.Context) PipelineOutput {
   502  	return o
   503  }
   504  
   505  // The codepipeline ARN.
   506  func (o PipelineOutput) Arn() pulumi.StringOutput {
   507  	return o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   508  }
   509  
   510  // One or more artifactStore blocks. Artifact stores are documented below.
   511  func (o PipelineOutput) ArtifactStores() PipelineArtifactStoreArrayOutput {
   512  	return o.ApplyT(func(v *Pipeline) PipelineArtifactStoreArrayOutput { return v.ArtifactStores }).(PipelineArtifactStoreArrayOutput)
   513  }
   514  
   515  // The method that the pipeline will use to handle multiple executions. The default mode is `SUPERSEDED`. For value values, refer to the [AWS documentation](https://docs.aws.amazon.com/codepipeline/latest/APIReference/API_PipelineDeclaration.html#CodePipeline-Type-PipelineDeclaration-executionMode).
   516  //
   517  // **Note:** `QUEUED` or `PARALLEL` mode can only be used with V2 pipelines.
   518  func (o PipelineOutput) ExecutionMode() pulumi.StringPtrOutput {
   519  	return o.ApplyT(func(v *Pipeline) pulumi.StringPtrOutput { return v.ExecutionMode }).(pulumi.StringPtrOutput)
   520  }
   521  
   522  // The name of the pipeline.
   523  func (o PipelineOutput) Name() pulumi.StringOutput {
   524  	return o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   525  }
   526  
   527  // Type of the pipeline. Possible values are: `V1` and `V2`. Default value is `V1`.
   528  func (o PipelineOutput) PipelineType() pulumi.StringPtrOutput {
   529  	return o.ApplyT(func(v *Pipeline) pulumi.StringPtrOutput { return v.PipelineType }).(pulumi.StringPtrOutput)
   530  }
   531  
   532  // A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
   533  func (o PipelineOutput) RoleArn() pulumi.StringOutput {
   534  	return o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput)
   535  }
   536  
   537  // A stage block. Stages are documented below.
   538  func (o PipelineOutput) Stages() PipelineStageArrayOutput {
   539  	return o.ApplyT(func(v *Pipeline) PipelineStageArrayOutput { return v.Stages }).(PipelineStageArrayOutput)
   540  }
   541  
   542  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   543  func (o PipelineOutput) Tags() pulumi.StringMapOutput {
   544  	return o.ApplyT(func(v *Pipeline) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   545  }
   546  
   547  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   548  //
   549  // Deprecated: Please use `tags` instead.
   550  func (o PipelineOutput) TagsAll() pulumi.StringMapOutput {
   551  	return o.ApplyT(func(v *Pipeline) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   552  }
   553  
   554  // A trigger block. Valid only when `pipelineType` is `V2`. Triggers are documented below.
   555  func (o PipelineOutput) Triggers() PipelineTriggerArrayOutput {
   556  	return o.ApplyT(func(v *Pipeline) PipelineTriggerArrayOutput { return v.Triggers }).(PipelineTriggerArrayOutput)
   557  }
   558  
   559  // A pipeline-level variable block. Valid only when `pipelineType` is `V2`. Variable are documented below.
   560  func (o PipelineOutput) Variables() PipelineVariableArrayOutput {
   561  	return o.ApplyT(func(v *Pipeline) PipelineVariableArrayOutput { return v.Variables }).(PipelineVariableArrayOutput)
   562  }
   563  
   564  type PipelineArrayOutput struct{ *pulumi.OutputState }
   565  
   566  func (PipelineArrayOutput) ElementType() reflect.Type {
   567  	return reflect.TypeOf((*[]*Pipeline)(nil)).Elem()
   568  }
   569  
   570  func (o PipelineArrayOutput) ToPipelineArrayOutput() PipelineArrayOutput {
   571  	return o
   572  }
   573  
   574  func (o PipelineArrayOutput) ToPipelineArrayOutputWithContext(ctx context.Context) PipelineArrayOutput {
   575  	return o
   576  }
   577  
   578  func (o PipelineArrayOutput) Index(i pulumi.IntInput) PipelineOutput {
   579  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Pipeline {
   580  		return vs[0].([]*Pipeline)[vs[1].(int)]
   581  	}).(PipelineOutput)
   582  }
   583  
   584  type PipelineMapOutput struct{ *pulumi.OutputState }
   585  
   586  func (PipelineMapOutput) ElementType() reflect.Type {
   587  	return reflect.TypeOf((*map[string]*Pipeline)(nil)).Elem()
   588  }
   589  
   590  func (o PipelineMapOutput) ToPipelineMapOutput() PipelineMapOutput {
   591  	return o
   592  }
   593  
   594  func (o PipelineMapOutput) ToPipelineMapOutputWithContext(ctx context.Context) PipelineMapOutput {
   595  	return o
   596  }
   597  
   598  func (o PipelineMapOutput) MapIndex(k pulumi.StringInput) PipelineOutput {
   599  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Pipeline {
   600  		return vs[0].(map[string]*Pipeline)[vs[1].(string)]
   601  	}).(PipelineOutput)
   602  }
   603  
   604  func init() {
   605  	pulumi.RegisterInputType(reflect.TypeOf((*PipelineInput)(nil)).Elem(), &Pipeline{})
   606  	pulumi.RegisterInputType(reflect.TypeOf((*PipelineArrayInput)(nil)).Elem(), PipelineArray{})
   607  	pulumi.RegisterInputType(reflect.TypeOf((*PipelineMapInput)(nil)).Elem(), PipelineMap{})
   608  	pulumi.RegisterOutputType(PipelineOutput{})
   609  	pulumi.RegisterOutputType(PipelineArrayOutput{})
   610  	pulumi.RegisterOutputType(PipelineMapOutput{})
   611  }