nuage.aws.ContainerFunction
Explore with Pulumi AI
Provides an AWS Lambda Function with additional necesary resources. It bundles several resources such as Lambda Functions
, Function URLs
, CloudWatch keep-warm rules
, Log Group with a Retention Policy
, Role to run Lambda and Write Logs
. It also has a feature for schedule (cron) definitions and automated X-Ray tracing.
Example Usage
Basic Example
Coming soon!
Coming soon!
Coming soon!
import pulumi_nuage as nuage
repository = nuage.aws.Repository(
"foo",
name="repository",
expire_in_days=30,
)
image = nuage.aws.Image(
"foo",
build_args=nuage.aws.DockerBuildArgs(
dockerfile="../api/Dockerfile",
context="../"
),
repository_url=repository.url,
)
container_function = nuage.aws.ContainerFunction("foo",
name="lambda-function",
description="Nuage AWS ContainerFunction resource.",
image_uri=image.uri,
architecture="X86_64",
memory_size=512,
timeout=30,
environment={"bar":"baz"},
keep_warm=True,
url=True,
log_retention_in_days=90,
schedule_config=nuage.aws.FunctionScheduleArgs(
schedule_expression="rate(5 minutes)"
),
)
Coming soon!
Coming soon!
Custom Policy Document Example
Coming soon!
Coming soon!
Coming soon!
import pulumi_nuage as nuage
policy_doc = aws.iam.get_policy_document(
version="2012-10-17",
statements=[
aws.iam.GetPolicyDocumentStatementArgs(
effect="Allow",
actions=["s3:*"],
resources=[
bucket.arn
],
),
],
).json
container_function = nuage.aws.ContainerFunction("foo",
name="lambda-function",
description="Nuage AWS ContainerFunction resource.",
image_uri=image.uri,
architecture="X86_64",
memory_size=512,
timeout=30,
environment={"bar":"baz"},
keep_warm=True,
url=True,
log_retention_in_days=90,
schedule_config=nuage.aws.FunctionScheduleArgs(
schedule_expression="rate(5 minutes)"
),
policy_document=policy_doc
)
Coming soon!
Coming soon!
Create ContainerFunction Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ContainerFunction(name: string, args: ContainerFunctionArgs, opts?: ComponentResourceOptions);
@overload
def ContainerFunction(resource_name: str,
args: ContainerFunctionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ContainerFunction(resource_name: str,
opts: Optional[ResourceOptions] = None,
image_uri: Optional[str] = None,
memory_size: Optional[int] = None,
environment: Optional[Mapping[str, str]] = None,
description: Optional[str] = None,
keep_warm: Optional[bool] = None,
log_retention_in_days: Optional[int] = None,
architecture: Optional[str] = None,
name: Optional[str] = None,
name_prefix: Optional[str] = None,
policy_document: Optional[str] = None,
schedule_config: Optional[FunctionScheduleArgs] = None,
timeout: Optional[int] = None,
url_config: Optional[FunctionUrlArgs] = None)
func NewContainerFunction(ctx *Context, name string, args ContainerFunctionArgs, opts ...ResourceOption) (*ContainerFunction, error)
public ContainerFunction(string name, ContainerFunctionArgs args, ComponentResourceOptions? opts = null)
public ContainerFunction(String name, ContainerFunctionArgs args)
public ContainerFunction(String name, ContainerFunctionArgs args, ComponentResourceOptions options)
type: nuage:aws:ContainerFunction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- opts ComponentResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- options ComponentResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var containerFunctionResource = new Nuage.Aws.ContainerFunction("containerFunctionResource", new()
{
ImageUri = "string",
MemorySize = 0,
Environment =
{
{ "string", "string" },
},
Description = "string",
KeepWarm = false,
LogRetentionInDays = 0,
Architecture = "string",
Name = "string",
NamePrefix = "string",
PolicyDocument = "string",
ScheduleConfig = new Nuage.Aws.Inputs.FunctionScheduleArgs
{
ScheduleExpression = "string",
ScheduleInput =
{
{ "string", "string" },
},
},
Timeout = 0,
UrlConfig = new Nuage.Aws.Inputs.FunctionUrlArgs
{
CorsConfiguration = new Aws.Lambda.Inputs.FunctionUrlCorsArgs
{
AllowCredentials = false,
AllowHeaders = new[]
{
"string",
},
AllowMethods = new[]
{
"string",
},
AllowOrigins = new[]
{
"string",
},
ExposeHeaders = new[]
{
"string",
},
MaxAge = 0,
},
UrlEnabled = false,
},
});
example, err := aws.NewContainerFunction(ctx, "containerFunctionResource", &aws.ContainerFunctionArgs{
ImageUri: pulumi.String("string"),
MemorySize: pulumi.Int(0),
Environment: pulumi.StringMap{
"string": pulumi.String("string"),
},
Description: pulumi.String("string"),
KeepWarm: pulumi.Bool(false),
LogRetentionInDays: pulumi.Int(0),
Architecture: pulumi.String("string"),
Name: pulumi.String("string"),
NamePrefix: pulumi.String("string"),
PolicyDocument: pulumi.String("string"),
ScheduleConfig: &aws.FunctionScheduleArgs{
ScheduleExpression: pulumi.String("string"),
ScheduleInput: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
Timeout: pulumi.Int(0),
UrlConfig: &aws.FunctionUrlArgs{
CorsConfiguration: &lambda.FunctionUrlCorsArgs{
AllowCredentials: pulumi.Bool(false),
AllowHeaders: pulumi.StringArray{
pulumi.String("string"),
},
AllowMethods: pulumi.StringArray{
pulumi.String("string"),
},
AllowOrigins: pulumi.StringArray{
pulumi.String("string"),
},
ExposeHeaders: pulumi.StringArray{
pulumi.String("string"),
},
MaxAge: pulumi.Int(0),
},
UrlEnabled: pulumi.Bool(false),
},
})
var containerFunctionResource = new ContainerFunction("containerFunctionResource", ContainerFunctionArgs.builder()
.imageUri("string")
.memorySize(0)
.environment(Map.of("string", "string"))
.description("string")
.keepWarm(false)
.logRetentionInDays(0)
.architecture("string")
.name("string")
.namePrefix("string")
.policyDocument("string")
.scheduleConfig(FunctionScheduleArgs.builder()
.scheduleExpression("string")
.scheduleInput(Map.of("string", "string"))
.build())
.timeout(0)
.urlConfig(FunctionUrlArgs.builder()
.corsConfiguration(FunctionUrlCorsArgs.builder()
.allowCredentials(false)
.allowHeaders("string")
.allowMethods("string")
.allowOrigins("string")
.exposeHeaders("string")
.maxAge(0)
.build())
.urlEnabled(false)
.build())
.build());
container_function_resource = nuage.aws.ContainerFunction("containerFunctionResource",
image_uri="string",
memory_size=0,
environment={
"string": "string",
},
description="string",
keep_warm=False,
log_retention_in_days=0,
architecture="string",
name="string",
name_prefix="string",
policy_document="string",
schedule_config={
"schedule_expression": "string",
"schedule_input": {
"string": "string",
},
},
timeout=0,
url_config={
"cors_configuration": {
"allow_credentials": False,
"allow_headers": ["string"],
"allow_methods": ["string"],
"allow_origins": ["string"],
"expose_headers": ["string"],
"max_age": 0,
},
"url_enabled": False,
})
const containerFunctionResource = new nuage.aws.ContainerFunction("containerFunctionResource", {
imageUri: "string",
memorySize: 0,
environment: {
string: "string",
},
description: "string",
keepWarm: false,
logRetentionInDays: 0,
architecture: "string",
name: "string",
namePrefix: "string",
policyDocument: "string",
scheduleConfig: {
scheduleExpression: "string",
scheduleInput: {
string: "string",
},
},
timeout: 0,
urlConfig: {
corsConfiguration: {
allowCredentials: false,
allowHeaders: ["string"],
allowMethods: ["string"],
allowOrigins: ["string"],
exposeHeaders: ["string"],
maxAge: 0,
},
urlEnabled: false,
},
});
type: nuage:aws:ContainerFunction
properties:
architecture: string
description: string
environment:
string: string
imageUri: string
keepWarm: false
logRetentionInDays: 0
memorySize: 0
name: string
namePrefix: string
policyDocument: string
scheduleConfig:
scheduleExpression: string
scheduleInput:
string: string
timeout: 0
urlConfig:
corsConfiguration:
allowCredentials: false
allowHeaders:
- string
allowMethods:
- string
allowOrigins:
- string
exposeHeaders:
- string
maxAge: 0
urlEnabled: false
ContainerFunction Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ContainerFunction resource accepts the following input properties:
- Image
Uri string - Image uri of the docker image.
- Architecture string
- Architecture, either
X86_64
orARM64
. Defaults toX86_64
- Description string
- Description of the function.
- Environment Dictionary<string, string>
- Environment Variables
- Keep
Warm bool - Keep warm by refreshing the lambda function every 5 minutes. Defaults to
false
- Log
Retention intIn Days - Number of days for log retention to pass in cloudwatch log group. Defaults to
90
- Memory
Size int - Amount of memory in MB your Lambda Function can use at runtime. Defaults to
512
. - Name string
- Name of the resource.
- Name
Prefix string - Name prefix as an alternative to name and adds random suffix at the end.
- Policy
Document string - Policy Document for lambda.
- Schedule
Config FunctionSchedule - Configure the function's cloudwatch event rule schedule.
- Timeout int
- Amount of time your Lambda Function has to run in seconds. Defaults to
3
- Url
Config FunctionUrl - Configure lambda function url.
- Image
Uri string - Image uri of the docker image.
- Architecture string
- Architecture, either
X86_64
orARM64
. Defaults toX86_64
- Description string
- Description of the function.
- Environment map[string]string
- Environment Variables
- Keep
Warm bool - Keep warm by refreshing the lambda function every 5 minutes. Defaults to
false
- Log
Retention intIn Days - Number of days for log retention to pass in cloudwatch log group. Defaults to
90
- Memory
Size int - Amount of memory in MB your Lambda Function can use at runtime. Defaults to
512
. - Name string
- Name of the resource.
- Name
Prefix string - Name prefix as an alternative to name and adds random suffix at the end.
- Policy
Document string - Policy Document for lambda.
- Schedule
Config FunctionSchedule Args - Configure the function's cloudwatch event rule schedule.
- Timeout int
- Amount of time your Lambda Function has to run in seconds. Defaults to
3
- Url
Config FunctionUrl Args - Configure lambda function url.
- image
Uri String - Image uri of the docker image.
- architecture String
- Architecture, either
X86_64
orARM64
. Defaults toX86_64
- description String
- Description of the function.
- environment Map<String,String>
- Environment Variables
- keep
Warm Boolean - Keep warm by refreshing the lambda function every 5 minutes. Defaults to
false
- log
Retention IntegerIn Days - Number of days for log retention to pass in cloudwatch log group. Defaults to
90
- memory
Size Integer - Amount of memory in MB your Lambda Function can use at runtime. Defaults to
512
. - name String
- Name of the resource.
- name
Prefix String - Name prefix as an alternative to name and adds random suffix at the end.
- policy
Document String - Policy Document for lambda.
- schedule
Config FunctionSchedule - Configure the function's cloudwatch event rule schedule.
- timeout Integer
- Amount of time your Lambda Function has to run in seconds. Defaults to
3
- url
Config FunctionUrl - Configure lambda function url.
- image
Uri string - Image uri of the docker image.
- architecture string
- Architecture, either
X86_64
orARM64
. Defaults toX86_64
- description string
- Description of the function.
- environment {[key: string]: string}
- Environment Variables
- keep
Warm boolean - Keep warm by refreshing the lambda function every 5 minutes. Defaults to
false
- log
Retention numberIn Days - Number of days for log retention to pass in cloudwatch log group. Defaults to
90
- memory
Size number - Amount of memory in MB your Lambda Function can use at runtime. Defaults to
512
. - name string
- Name of the resource.
- name
Prefix string - Name prefix as an alternative to name and adds random suffix at the end.
- policy
Document string - Policy Document for lambda.
- schedule
Config FunctionSchedule - Configure the function's cloudwatch event rule schedule.
- timeout number
- Amount of time your Lambda Function has to run in seconds. Defaults to
3
- url
Config FunctionUrl - Configure lambda function url.
- image_
uri str - Image uri of the docker image.
- architecture str
- Architecture, either
X86_64
orARM64
. Defaults toX86_64
- description str
- Description of the function.
- environment Mapping[str, str]
- Environment Variables
- keep_
warm bool - Keep warm by refreshing the lambda function every 5 minutes. Defaults to
false
- log_
retention_ intin_ days - Number of days for log retention to pass in cloudwatch log group. Defaults to
90
- memory_
size int - Amount of memory in MB your Lambda Function can use at runtime. Defaults to
512
. - name str
- Name of the resource.
- name_
prefix str - Name prefix as an alternative to name and adds random suffix at the end.
- policy_
document str - Policy Document for lambda.
- schedule_
config FunctionSchedule Args - Configure the function's cloudwatch event rule schedule.
- timeout int
- Amount of time your Lambda Function has to run in seconds. Defaults to
3
- url_
config FunctionUrl Args - Configure lambda function url.
- image
Uri String - Image uri of the docker image.
- architecture String
- Architecture, either
X86_64
orARM64
. Defaults toX86_64
- description String
- Description of the function.
- environment Map<String>
- Environment Variables
- keep
Warm Boolean - Keep warm by refreshing the lambda function every 5 minutes. Defaults to
false
- log
Retention NumberIn Days - Number of days for log retention to pass in cloudwatch log group. Defaults to
90
- memory
Size Number - Amount of memory in MB your Lambda Function can use at runtime. Defaults to
512
. - name String
- Name of the resource.
- name
Prefix String - Name prefix as an alternative to name and adds random suffix at the end.
- policy
Document String - Policy Document for lambda.
- schedule
Config Property Map - Configure the function's cloudwatch event rule schedule.
- timeout Number
- Amount of time your Lambda Function has to run in seconds. Defaults to
3
- url
Config Property Map - Configure lambda function url.
Outputs
All input properties are implicitly available as output properties. Additionally, the ContainerFunction resource produces the following output properties:
Supporting Types
FunctionSchedule, FunctionScheduleArgs
- Schedule
Expression string - Expression for creating a cloudwatch event rule.
- Schedule
Input Dictionary<string, string> - Input for cloudwatch event target.
- Schedule
Expression string - Expression for creating a cloudwatch event rule.
- Schedule
Input map[string]string - Input for cloudwatch event target.
- schedule
Expression String - Expression for creating a cloudwatch event rule.
- schedule
Input Map<String,String> - Input for cloudwatch event target.
- schedule
Expression string - Expression for creating a cloudwatch event rule.
- schedule
Input {[key: string]: string} - Input for cloudwatch event target.
- schedule_
expression str - Expression for creating a cloudwatch event rule.
- schedule_
input Mapping[str, str] - Input for cloudwatch event target.
- schedule
Expression String - Expression for creating a cloudwatch event rule.
- schedule
Input Map<String> - Input for cloudwatch event target.
FunctionUrl, FunctionUrlArgs
- Cors
Configuration Pulumi.Aws. Lambda. Inputs. Function Url Cors - CORS Configuration. This type is defined in the AWS Classic package.
- Url
Enabled bool - Use Lambda URL. Defaults to
false
- Cors
Configuration FunctionUrl Cors - CORS Configuration. This type is defined in the AWS Classic package.
- Url
Enabled bool - Use Lambda URL. Defaults to
false
- cors
Configuration FunctionUrl Cors - CORS Configuration. This type is defined in the AWS Classic package.
- url
Enabled Boolean - Use Lambda URL. Defaults to
false
- cors
Configuration pulumiAws.types.input.lambda. Function Url Cors - CORS Configuration. This type is defined in the AWS Classic package.
- url
Enabled boolean - Use Lambda URL. Defaults to
false
- cors_
configuration pulumi_aws.lambda_. Function Url Cors Args - CORS Configuration. This type is defined in the AWS Classic package.
- url_
enabled bool - Use Lambda URL. Defaults to
false
- cors
Configuration Property Map - CORS Configuration. This type is defined in the AWS Classic package.
- url
Enabled Boolean - Use Lambda URL. Defaults to
false
Package Details
- Repository
- nuage
- License
- Apache-2.0