# Artifacts

Artifacts definition for a CodeBuild Project.

Implements: [IArtifacts](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.IArtifacts.html)

- 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#L55)

## 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

- `identifier`: string — The artifact identifier.

  This property is required on secondary artifacts.

- `type`: string — The CodeBuild type of this artifact.

## Methods

- `bind(_scope: Construct, _project: IProject): ArtifactsConfig` — Callback when an Artifacts class is used in a CodeBuild Project.

- `s3(props: S3ArtifactsProps): IArtifacts` (static)
