# SecretTargetAttachmentProps

Construction properties for an AttachedSecret.

Extends: [AttachedSecretOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.AttachedSecretOptions.html)
Used as props by: [SecretTargetAttachment](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment.html)

- Source: [`aws-secretsmanager/lib/secret.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-secretsmanager/lib/secret.ts#L874)

## Example

TypeScript:

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

declare const secret: secretsmanager.Secret;
declare const secretAttachmentTarget: secretsmanager.ISecretAttachmentTarget;
const secretTargetAttachmentProps: secretsmanager.SecretTargetAttachmentProps = {
  secret: secret,
  target: secretAttachmentTarget,
};
```

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_secretsmanager as secretsmanager

# secret: secretsmanager.Secret
# secret_attachment_target: secretsmanager.ISecretAttachmentTarget

secret_target_attachment_props = secretsmanager.SecretTargetAttachmentProps(
    secret=secret,
    target=secret_attachment_target
)
```

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

Secret secret;
ISecretAttachmentTarget secretAttachmentTarget;

SecretTargetAttachmentProps secretTargetAttachmentProps = SecretTargetAttachmentProps.builder()
        .secret(secret)
        .target(secretAttachmentTarget)
        .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.SecretsManager;

Secret secret;
ISecretAttachmentTarget secretAttachmentTarget;

var secretTargetAttachmentProps = new SecretTargetAttachmentProps {
    Secret = secret,
    Target = secretAttachmentTarget
};
```

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 secret Secret
var secretAttachmentTarget ISecretAttachmentTarget

secretTargetAttachmentProps := &SecretTargetAttachmentProps{
	Secret: secret,
	Target: secretAttachmentTarget,
}
```

## Properties

- `secret`: [ISecret](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) (required) — The secret to attach to the target.

- `target`: [ISecretAttachmentTarget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecretAttachmentTarget.html) (required) — The target to attach the secret to.
