# CfnAssetProps

Properties for defining a `CfnAsset`.

Used as props by: [CfnAsset](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_devopsagent.CfnAsset.html)

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 2026

## Example

TypeScript:

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

declare const metadata: any;
const cfnAssetProps: devopsagent.CfnAssetProps = {
  agentSpaceId: 'agentSpaceId',
  assetType: 'assetType',

  // the properties below are optional
  files: [{
    path: 'path',

    // the properties below are optional
    contentBytes: 'contentBytes',
    contentText: 'contentText',
    metadata: metadata,
  }],
  metadata: metadata,
  zip: 'zip',
};
```

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_devopsagent as devopsagent

# metadata: Any

cfn_asset_props = devopsagent.CfnAssetProps(
    agent_space_id="agentSpaceId",
    asset_type="assetType",

    # the properties below are optional
    files=[devopsagent.CfnAsset.AssetFileProperty(
        path="path",

        # the properties below are optional
        content_bytes="contentBytes",
        content_text="contentText",
        metadata=metadata
    )],
    metadata=metadata,
    zip="zip"
)
```

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

Object metadata;

CfnAssetProps cfnAssetProps = CfnAssetProps.builder()
        .agentSpaceId("agentSpaceId")
        .assetType("assetType")

        // the properties below are optional
        .files(List.of(AssetFileProperty.builder()
                .path("path")

                // the properties below are optional
                .contentBytes("contentBytes")
                .contentText("contentText")
                .metadata(metadata)
                .build()))
        .metadata(metadata)
        .zip("zip")
        .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.DevOpsAgent;

var metadata;

var cfnAssetProps = new CfnAssetProps {
    AgentSpaceId = "agentSpaceId",
    AssetType = "assetType",

    // the properties below are optional
    Files = new [] { new AssetFileProperty {
        Path = "path",

        // the properties below are optional
        ContentBytes = "contentBytes",
        ContentText = "contentText",
        Metadata = metadata
    } },
    Metadata = metadata,
    Zip = "zip"
};
```

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"

var metadata interface{}

cfnAssetProps := &CfnAssetProps{
	AgentSpaceId: jsii.String("agentSpaceId"),
	AssetType: jsii.String("assetType"),

	// the properties below are optional
	Files: []interface{}{
		&AssetFileProperty{
			Path: jsii.String("path"),

			// the properties below are optional
			ContentBytes: jsii.String("contentBytes"),
			ContentText: jsii.String("contentText"),
			Metadata: metadata,
		},
	},
	Metadata: metadata,
	Zip: jsii.String("zip"),
}
```

## Properties

- `agentSpaceId`: string (required) — The unique identifier of the parent Agent Space.

  The asset is created as a child of this agent space.

- `assetType`: string (required) — The type of asset.

  The Asset API treats this as an open string; call ListAssetTypes for the current authoritative set of supported types. As of launch, customer-creatable types include skill, agents_md, and attachment.

- `files`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAsset.AssetFileProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_devopsagent.CfnAsset.AssetFileProperty.html)[] — Inline file list.

  Mutually exclusive with Zip; enforced by the handler at Create/Update time. Write-only: not repopulated by Read.

- `metadata`: any — Asset metadata document.

  Required and optional keys depend on AssetType. Values may be strings, numbers, booleans, or lists of any of those - validated server-side; see the public Asset API docs for the per-type metadata schema.

- `zip`: string — Base64-encoded zip bundle containing all files for the asset.

  Mutually exclusive with Files; enforced by the handler at Create/Update time. Write-only: not repopulated by Read. Server treats a zip as 'replace all files' (max 6 MiB).
