# SourceConfig

Source information.

Returned by: [ISource.bind](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_deployment.ISource.html#bind)

- Source: [`aws-s3-deployment/lib/source.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-s3-deployment/lib/source.ts#L19)
- Type last changed: v2.190.0 · 17 Apr 2025

## Example

TypeScript:

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

declare const bucket: s3.Bucket;
declare const markers: any;
const sourceConfig: s3_deployment.SourceConfig = {
  bucket: bucket,
  zipObjectKey: 'zipObjectKey',

  // the properties below are optional
  markers: {
    markersKey: markers,
  },
  markersConfig: {
    jsonEscape: false,
    markerEncodings: {
      markerEncodingsKey: s3_deployment.MarkerEncoding.LITERAL,
    },
  },
};
```

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_s3 as s3
from aws_cdk import aws_s3_deployment as s3_deployment

# bucket: s3.Bucket
# markers: Any

source_config = s3_deployment.SourceConfig(
    bucket=bucket,
    zip_object_key="zipObjectKey",

    # the properties below are optional
    markers={
        "markers_key": markers
    },
    markers_config=s3_deployment.MarkersConfig(
        json_escape=False,
        marker_encodings={
            "marker_encodings_key": s3_deployment.MarkerEncoding.LITERAL
        }
    )
)
```

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.s3.*;
import software.amazon.awscdk.services.s3.deployment.*;

Bucket bucket;
Object markers;

SourceConfig sourceConfig = SourceConfig.builder()
        .bucket(bucket)
        .zipObjectKey("zipObjectKey")

        // the properties below are optional
        .markers(Map.of(
                "markersKey", markers))
        .markersConfig(MarkersConfig.builder()
                .jsonEscape(false)
                .markerEncodings(Map.of(
                        "markerEncodingsKey", MarkerEncoding.LITERAL))
                .build())
        .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.S3;
using Amazon.CDK.AWS.S3.Deployment;

Bucket bucket;
var markers;

var sourceConfig = new SourceConfig {
    Bucket = bucket,
    ZipObjectKey = "zipObjectKey",

    // the properties below are optional
    Markers = new Dictionary<string, object> {
        { "markersKey", markers }
    },
    MarkersConfig = new MarkersConfig {
        JsonEscape = false,
        MarkerEncodings = new Dictionary<string, MarkerEncoding> {
            { "markerEncodingsKey", MarkerEncoding.LITERAL }
        }
    }
};
```

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"

var bucket Bucket
var markers interface{}

sourceConfig := &SourceConfig{
	Bucket: bucket,
	ZipObjectKey: jsii.String("zipObjectKey"),

	// the properties below are optional
	Markers: map[string]interface{}{
		"markersKey": markers,
	},
	MarkersConfig: &MarkersConfig{
		JsonEscape: jsii.Boolean(false),
		MarkerEncodings: map[string]MarkerEncoding{
			"markerEncodingsKey": awscdk.aws_s3_deployment.MarkerEncoding_LITERAL,
		},
	},
}
```

## Properties

- `bucket`: [IBucket](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) (required) — The source bucket to deploy from.

- `markers`: { [key: string]: any } — A set of markers to substitute in the source content.

  **Default:** no markers

  Keys are the markers to replace, and values are the replacement CloudFormation
  expressions.

- `markersConfig`: [MarkersConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3_deployment.MarkersConfig.html) — A configuration for markers substitution strategy.

  **Default:** no configuration

- `zipObjectKey`: string (required) — An S3 object key in the source bucket that points to a zip file.
