# S3SourceOptions

Options for S3 sources.

Used as argument in: [CodePipelineSource.s3](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.pipelines.CodePipelineSource.html#s3)

- Source: [`pipelines/lib/codepipeline/codepipeline-source.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/pipelines/lib/codepipeline/codepipeline-source.ts#L286)
- Type last changed: v2.27.0 · 3 Jun 2022

## Example

TypeScript:

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

declare const role: iam.Role;
const s3SourceOptions: pipelines.S3SourceOptions = {
  actionName: 'actionName',
  role: role,
  trigger: codepipeline_actions.S3Trigger.NONE,
};
```

Python:

```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_actions as codepipeline_actions
from aws_cdk import aws_iam as iam
from aws_cdk import pipelines

# role: iam.Role

s3_source_options = pipelines.S3SourceOptions(
    action_name="actionName",
    role=role,
    trigger=codepipeline_actions.S3Trigger.NONE
)
```

Java:

```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.actions.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.pipelines.*;

Role role;

S3SourceOptions s3SourceOptions = S3SourceOptions.builder()
        .actionName("actionName")
        .role(role)
        .trigger(S3Trigger.NONE)
        .build();
```

C# / .NET:

```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.Actions;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.Pipelines;

Role role;

var s3SourceOptions = new S3SourceOptions {
    ActionName = "actionName",
    Role = role,
    Trigger = S3Trigger.NONE
};
```

Golang:

```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"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var role Role

s3SourceOptions := &S3SourceOptions{
	ActionName: jsii.String("actionName"),
	Role: role,
	Trigger: awscdk.Aws_codepipeline_actions.S3Trigger_NONE,
}
```

## Properties

- `actionName`: string — The action name used for this source in the CodePipeline.

  **Default:** The bucket name

- `role`: [IRole](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The role that will be assumed by the pipeline prior to executing the `S3Source` action.

  **Default:** a new role will be generated

- `trigger`: [S3Trigger](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions.S3Trigger.html) = S3Trigger.POLL — How should CodePipeline detect source changes for this Action.

  Note that if this is S3Trigger.EVENTS, you need to make sure to include the source Bucket in a CloudTrail Trail,
  as otherwise the CloudWatch Events will not be emitted.
