# S3ArtifactsProps

Construction properties for `S3Artifacts`.

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

- Source: [`aws-codebuild/lib/artifacts.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-codebuild/lib/artifacts.ts#L80)

## Example

TypeScript:

```ts
declare const bucket: s3.Bucket;

const project = new codebuild.Project(this, 'MyProject', {
  buildSpec: codebuild.BuildSpec.fromObject({
    version: '0.2',
  }),
  artifacts: codebuild.Artifacts.s3({
      bucket,
      includeBuildId: false,
      packageZip: true,
      path: 'another/path',
      identifier: 'AddArtifact1',
    }),
});
```

Python:

```python
# bucket: s3.Bucket

project = codebuild.Project(self, "MyProject",
    build_spec=codebuild.BuildSpec.from_object({
        "version": "0.2"
    }),
    artifacts=codebuild.Artifacts.s3(
        bucket=bucket,
        include_build_id=False,
        package_zip=True,
        path="another/path",
        identifier="AddArtifact1"
    )
)
```

Java:

```java
Bucket bucket;

Project project = Project.Builder.create(this, "MyProject")
        .buildSpec(BuildSpec.fromObject(Map.of(
                "version", "0.2")))
        .artifacts(Artifacts.s3(S3ArtifactsProps.builder()
                .bucket(bucket)
                .includeBuildId(false)
                .packageZip(true)
                .path("another/path")
                .identifier("AddArtifact1")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Bucket bucket;

var project = new Project(this, "MyProject", new ProjectProps {
    BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
        { "version", "0.2" }
    }),
    Artifacts = Artifacts.S3(new S3ArtifactsProps {
        Bucket = bucket,
        IncludeBuildId = false,
        PackageZip = true,
        Path = "another/path",
        Identifier = "AddArtifact1"
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var bucket Bucket

project := codebuild.NewProject(this, jsii.String("MyProject"), &ProjectProps{
	BuildSpec: codebuild.BuildSpec_FromObject(map[string]interface{}{
		"version": jsii.String("0.2"),
	}),
	Artifacts: codebuild.Artifacts_S3(&S3ArtifactsProps{
		Bucket: *Bucket,
		IncludeBuildId: jsii.Boolean(false),
		PackageZip: jsii.Boolean(true),
		Path: jsii.String("another/path"),
		Identifier: jsii.String("AddArtifact1"),
	}),
})
```

## Properties

- `bucket`: [IBucket](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) (required) — The name of the output bucket.

- `encryption`: boolean — If this is false, build output will not be encrypted.

  **Default:** true - output will be encrypted

  This is useful if the artifact to publish a static website or sharing content with others

- `identifier`: string — The artifact identifier.

  This property is required on secondary artifacts.

- `includeBuildId`: boolean = true — Indicates if the build ID should be included in the path.

  If this is set to true,
  then the build artifact will be stored in "<path>/<build-id>/<name>".

- `name`: string — The name of the build output ZIP file or folder inside the bucket.

  **Default:** undefined, and use the name from the buildspec

  The full S3 object key will be "<path>/<build-id>/<name>" or
  "<path>/<name>" depending on whether `includeBuildId` is set to true.

  If not set, `overrideArtifactName` will be set and the name from the
  buildspec will be used instead.

- `packageZip`: boolean — If this is true, all build output will be packaged into a single .zip file. Otherwise, all files will be uploaded to <path>/<name>.

  **Default:** true - files will be archived

- `path`: string — The path inside of the bucket for the build output .zip file or folder. If a value is not specified, then build output will be stored at the root of the bucket (or under the <build-id> directory if `includeBuildId` is set to true).

  **Default:** the root of the bucket
