# InjectionContext

This defines the values needed for Injection.

Used as argument in: [IPropertyInjector.inject](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IPropertyInjector.html#inject)

- Source: [`core/lib/prop-injectors.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/prop-injectors.ts#L7)
- Type last changed: v2.196.0 · 16 May 2025

## Example

TypeScript:

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

declare const construct: constructs.Construct;
const injectionContext: cdk.InjectionContext = {
  id: 'id',
  scope: construct,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
import constructs as constructs

# construct: constructs.Construct

injection_context = cdk.InjectionContext(
    id="id",
    scope=construct
)
```

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.*;
import software.constructs.*;

Construct construct;

InjectionContext injectionContext = InjectionContext.builder()
        .id("id")
        .scope(construct)
        .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;
using Constructs;

Construct construct;
var injectionContext = new InjectionContext {
    Id = "id",
    Scope = construct
};
```

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 cdk "github.com/aws/aws-cdk-go/awscdk"
import constructs "github.com/aws/constructs-go/constructs"

var construct Construct

injectionContext := &InjectionContext{
	Id: jsii.String("id"),
	Scope: construct,
}
```

## Properties

- `id`: string (required) — id from the Construct constructor.

- `scope`: [Construct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.Construct.html) (required) — scope from the constructor.
