# WorkloadIdentityProps

Properties for a new {@link WorkloadIdentity}.

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

- Source: [`aws-bedrockagentcore/lib/identity/workload-identity.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/identity/workload-identity.ts#L101)
- Type last changed: v2.255.0 · 19 May 2026

## Example

TypeScript:

```ts
new agentcore.WorkloadIdentity(this, "MyWorkloadIdentity", {
  workloadIdentityName: "customer-support-agent-prod",
  allowedResourceOauth2ReturnUrls: ["https://app.example.com/oauth/callback"],
  tags: { team: "agents", env: "prod" },
});
```

Python:

```python
agentcore.WorkloadIdentity(self, "MyWorkloadIdentity",
    workload_identity_name="customer-support-agent-prod",
    allowed_resource_oauth2_return_urls=["https://app.example.com/oauth/callback"],
    tags={"team": "agents", "env": "prod"}
)
```

Java:

```java
WorkloadIdentity.Builder.create(this, "MyWorkloadIdentity")
        .workloadIdentityName("customer-support-agent-prod")
        .allowedResourceOauth2ReturnUrls(List.of("https://app.example.com/oauth/callback"))
        .tags(Map.of("team", "agents", "env", "prod"))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
new WorkloadIdentity(this, "MyWorkloadIdentity", new WorkloadIdentityProps {
    WorkloadIdentityName = "customer-support-agent-prod",
    AllowedResourceOauth2ReturnUrls = new [] { "https://app.example.com/oauth/callback" },
    Tags = new Dictionary<string, string> { { "team", "agents" }, { "env", "prod" } }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
agentcore.NewWorkloadIdentity(this, jsii.String("MyWorkloadIdentity"), &WorkloadIdentityProps{
	WorkloadIdentityName: jsii.String("customer-support-agent-prod"),
	AllowedResourceOauth2ReturnUrls: []*string{
		jsii.String("https://app.example.com/oauth/callback"),
	},
	Tags: map[string]*string{
		"team": jsii.String("agents"),
		"env": jsii.String("prod"),
	},
})
```

## Properties

- `allowedResourceOauth2ReturnUrls`: string[] — Allowed OAuth2 return URLs for resources associated with this workload identity.

  **Default:** no return URLs

- `tags`: { [key: string]: string } — Tags for this workload identity.

  **Default:** no tags

- `workloadIdentityName`: string — Name of the workload identity.

  **Default:** a name generated by CDK
