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
new ContainerFunction(name: string, args: ContainerFunctionArgs, opts?: CustomResourceOptions);
@overload
def ContainerFunction(resource_name: str,
opts: Optional[ResourceOptions] = None,
architecture: Optional[str] = None,
description: Optional[str] = None,
environment: Optional[Mapping[str, str]] = None,
image_uri: Optional[str] = None,
keep_warm: Optional[bool] = None,
log_retention_in_days: Optional[int] = None,
memory_size: Optional[int] = 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)
@overload
def ContainerFunction(resource_name: str,
args: ContainerFunctionArgs,
opts: Optional[ResourceOptions] = None)
func NewContainerFunction(ctx *Context, name string, args ContainerFunctionArgs, opts ...ResourceOption) (*ContainerFunction, error)
public ContainerFunction(string name, ContainerFunctionArgs args, CustomResourceOptions? opts = null)
public ContainerFunction(String name, ContainerFunctionArgs args)
public ContainerFunction(String name, ContainerFunctionArgs args, CustomResourceOptions options)
type: nuage:aws:ContainerFunction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- 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 CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContainerFunctionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
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
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.
- Url
Enabled bool Use Lambda URL. Defaults to
false
- Cors
Configuration FunctionUrl Cors CORS Configuration.
- Url
Enabled bool Use Lambda URL. Defaults to
false
- cors
Configuration FunctionUrl Cors CORS Configuration.
- url
Enabled Boolean Use Lambda URL. Defaults to
false
- cors
Configuration pulumiAws.types.input.lambda. Function Url Cors CORS Configuration.
- url
Enabled boolean Use Lambda URL. Defaults to
false
- cors_
configuration FunctionUrl Cors Args CORS Configuration.
- url_
enabled bool Use Lambda URL. Defaults to
false
- cors
Configuration Property Map CORS Configuration.
- url
Enabled Boolean Use Lambda URL. Defaults to
false
Package Details
- Repository
- nuage
- License
- Apache-2.0