Skip to content
v2.278.0

LambdaValidator Class ​

Defines an AWS Lambda validator.

Example ​

ts
declare const application: appconfig.Application;
declare const fn: lambda.Function;

new appconfig.HostedConfiguration(this, 'MyHostedConfiguration', {
  application,
  content: appconfig.ConfigurationContent.fromInlineText('This is my configuration content.'),
  validators: [
    appconfig.JsonSchemaValidator.fromFile('schema.json'),
    appconfig.LambdaValidator.fromFunction(fn),
  ],
});
python
# application: appconfig.Application
# fn: lambda.Function


appconfig.HostedConfiguration(self, "MyHostedConfiguration",
    application=application,
    content=appconfig.ConfigurationContent.from_inline_text("This is my configuration content."),
    validators=[
        appconfig.JsonSchemaValidator.from_file("schema.json"),
        appconfig.LambdaValidator.from_function(fn)
    ]
)
java
Application application;
Function fn;


HostedConfiguration.Builder.create(this, "MyHostedConfiguration")
        .application(application)
        .content(ConfigurationContent.fromInlineText("This is my configuration content."))
        .validators(List.of(JsonSchemaValidator.fromFile("schema.json"), LambdaValidator.fromFunction(fn)))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Application application;
Function fn;


new HostedConfiguration(this, "MyHostedConfiguration", new HostedConfigurationProps {
    Application = application,
    Content = ConfigurationContent.FromInlineText("This is my configuration content."),
    Validators = new [] { JsonSchemaValidator.FromFile("schema.json"), LambdaValidator.FromFunction(fn) }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var application Application
var fn Function


appconfig.NewHostedConfiguration(this, jsii.String("MyHostedConfiguration"), &HostedConfigurationProps{
	Application: Application,
	Content: appconfig.ConfigurationContent_FromInlineText(jsii.String("This is my configuration content.")),
	Validators: []IValidator{
		appconfig.JsonSchemaValidator_FromFile(jsii.String("schema.json")),
		appconfig.LambdaValidator_FromFunction(fn),
	},
})

Initializer ​

ts
new LambdaValidator()
python
LambdaValidator()
java
new LambdaValidator()
csharp
new LambdaValidator()
go
NewLambdaValidator()

Properties ​

contentstringcontentstrcontentStringContentstringContent*string #
The content of the validator.

Methods ​

fromFunction(func: Function): LambdaValidator // chainable@staticmethod def from_function(func: Function) -> LambdaValidatorpublic static LambdaValidator fromFunction(Function func)public static LambdaValidator FromFunction(Function func)func FromFunction(Func Function) LambdaValidator static #
Defines an AWS Lambda validator from a Lambda function.

This will call addPermission to your function to grant AWS AppConfig permissions.

1 parameter

Parameters

  • funcfuncfuncfuncFunc — The function that defines the validator.