Skip to content
v2.278.0

InjectionContext Struct ​

This defines the values needed for Injection.

Example ​

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
# 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
// 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();
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
};
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 ​

idstringidstridStringIdstringId*string required #
id from the Construct constructor.
scopeConstructscopeConstructscopeConstructScopeConstructScopeConstruct required #
scope from the constructor.