# ArtifactsProperty

`Artifacts` is a property of the [AWS::CodeBuild::Project](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html) resource that specifies output settings for artifacts generated by an AWS CodeBuild build.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
const artifactsProperty: codebuild.CfnProject.ArtifactsProperty = {
  type: 'type',

  // the properties below are optional
  artifactIdentifier: 'artifactIdentifier',
  encryptionDisabled: false,
  location: 'location',
  name: 'name',
  namespaceType: 'namespaceType',
  overrideArtifactName: false,
  packaging: 'packaging',
  path: 'path',
};
```

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_codebuild as codebuild

artifacts_property = codebuild.CfnProject.ArtifactsProperty(
    type="type",

    # the properties below are optional
    artifact_identifier="artifactIdentifier",
    encryption_disabled=False,
    location="location",
    name="name",
    namespace_type="namespaceType",
    override_artifact_name=False,
    packaging="packaging",
    path="path"
)
```

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.codebuild.*;

ArtifactsProperty artifactsProperty = ArtifactsProperty.builder()
        .type("type")

        // the properties below are optional
        .artifactIdentifier("artifactIdentifier")
        .encryptionDisabled(false)
        .location("location")
        .name("name")
        .namespaceType("namespaceType")
        .overrideArtifactName(false)
        .packaging("packaging")
        .path("path")
        .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.CodeBuild;

var artifactsProperty = new ArtifactsProperty {
    Type = "type",

    // the properties below are optional
    ArtifactIdentifier = "artifactIdentifier",
    EncryptionDisabled = false,
    Location = "location",
    Name = "name",
    NamespaceType = "namespaceType",
    OverrideArtifactName = false,
    Packaging = "packaging",
    Path = "path"
};
```

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"

artifactsProperty := &ArtifactsProperty{
	Type: jsii.String("type"),

	// the properties below are optional
	ArtifactIdentifier: jsii.String("artifactIdentifier"),
	EncryptionDisabled: jsii.Boolean(false),
	Location: jsii.String("location"),
	Name: jsii.String("name"),
	NamespaceType: jsii.String("namespaceType"),
	OverrideArtifactName: jsii.Boolean(false),
	Packaging: jsii.String("packaging"),
	Path: jsii.String("path"),
}
```

## Properties

- `artifactIdentifier`: string — An identifier for this artifact definition.

- `encryptionDisabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Set to true if you do not want your output artifacts encrypted.

  This option is valid only if your artifacts type is Amazon Simple Storage Service (Amazon S3). If this is set with another artifacts type, an `invalidInputException` is thrown.

- `location`: string — Information about the build output artifact location:.

  - If `type` is set to `CODEPIPELINE` , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output locations instead of CodeBuild .
  - If `type` is set to `NO_ARTIFACTS` , this value is ignored if specified, because no build output is produced.
  - If `type` is set to `S3` , this is the name of the output bucket.

  If you specify `CODEPIPELINE` or `NO_ARTIFACTS` for the `Type` property, don't specify this property. For all of the other types, you must specify this property.

- `name`: string — Along with `path` and `namespaceType` , the pattern that AWS CodeBuild uses to name and store the output artifact:.

  - If `type` is set to `CODEPIPELINE` , AWS CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .
  - If `type` is set to `NO_ARTIFACTS` , this value is ignored if specified, because no build output is produced.
  - If `type` is set to `S3` , this is the name of the output artifact object. If you set the name to be a forward slash ("/"), the artifact is stored in the root of the output bucket.

  For example:

  - If `path` is set to `MyArtifacts` , `namespaceType` is set to `BUILD_ID` , and `name` is set to `MyArtifact.zip` , then the output artifact is stored in `MyArtifacts/ *build-ID* /MyArtifact.zip` .
  - If `path` is empty, `namespaceType` is set to `NONE` , and `name` is set to " `/` ", the output artifact is stored in the root of the output bucket.
  - If `path` is set to `MyArtifacts` , `namespaceType` is set to `BUILD_ID` , and `name` is set to " `/` ", the output artifact is stored in `MyArtifacts/ *build-ID*` .

  If you specify `CODEPIPELINE` or `NO_ARTIFACTS` for the `Type` property, don't specify this property. For all of the other types, you must specify this property.

- `namespaceType`: string — Along with `path` and `name` , the pattern that AWS CodeBuild uses to determine the name and location to store the output artifact: - If `type` is set to `CODEPIPELINE` , CodePipeline ignores this value if specified.

  This is because CodePipeline manages its build output names instead of AWS CodeBuild .
  - If `type` is set to `NO_ARTIFACTS` , this value is ignored if specified, because no build output is produced.
  - If `type` is set to `S3` , valid values include:

  - `BUILD_ID` : Include the build ID in the location of the build output artifact.
  - `NONE` : Do not include the build ID. This is the default if `namespaceType` is not specified.

  For example, if `path` is set to `MyArtifacts` , `namespaceType` is set to `BUILD_ID` , and `name` is set to `MyArtifact.zip` , the output artifact is stored in `MyArtifacts/<build-ID>/MyArtifact.zip` .

- `overrideArtifactName`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — If set to true a name specified in the buildspec file overrides the artifact name.

  The name specified in a buildspec file is calculated at build time and uses the Shell command language. For example, you can append a date and time to your artifact name so that it is always unique.

- `packaging`: string — The type of build output artifact to create:.

  - If `type` is set to `CODEPIPELINE` , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output artifacts instead of AWS CodeBuild .
  - If `type` is set to `NO_ARTIFACTS` , this value is ignored if specified, because no build output is produced.
  - If `type` is set to `S3` , valid values include:

  - `NONE` : AWS CodeBuild creates in the output bucket a folder that contains the build output. This is the default if `packaging` is not specified.
  - `ZIP` : AWS CodeBuild creates in the output bucket a ZIP file that contains the build output.

- `path`: string — Along with `namespaceType` and `name` , the pattern that AWS CodeBuild uses to name and store the output artifact:.

  - If `type` is set to `CODEPIPELINE` , CodePipeline ignores this value if specified. This is because CodePipeline manages its build output names instead of AWS CodeBuild .
  - If `type` is set to `NO_ARTIFACTS` , this value is ignored if specified, because no build output is produced.
  - If `type` is set to `S3` , this is the path to the output artifact. If `path` is not specified, `path` is not used.

  For example, if `path` is set to `MyArtifacts` , `namespaceType` is set to `NONE` , and `name` is set to `MyArtifact.zip` , the output artifact is stored in the output bucket at `MyArtifacts/MyArtifact.zip` .

- `type`: string (required) — The type of build output artifact. Valid values include:.

  - `CODEPIPELINE` : The build project has build output generated through CodePipeline.

  > The `CODEPIPELINE` type is not supported for `secondaryArtifacts` .
  - `NO_ARTIFACTS` : The build project does not produce any build output.
  - `S3` : The build project stores build output in Amazon S3.
