1. Packages
  2. Pulumi Nuage
  3. API Docs
  4. aws
  5. ContainerFunction
nuage v0.1.1 published on Friday, Mar 17, 2023 by Nuage-Studio

nuage.aws.ContainerFunction

Explore with Pulumi AI

nuage logo
nuage v0.1.1 published on Friday, Mar 17, 2023 by Nuage-Studio

    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:

    ImageUri string

    Image uri of the docker image.

    Architecture string

    Architecture, either X86_64 or ARM64. Defaults to X86_64

    Description string

    Description of the function.

    Environment Dictionary<string, string>

    Environment Variables

    KeepWarm bool

    Keep warm by refreshing the lambda function every 5 minutes. Defaults to false

    LogRetentionInDays int

    Number of days for log retention to pass in cloudwatch log group. Defaults to 90

    MemorySize int

    Amount of memory in MB your Lambda Function can use at runtime. Defaults to 512.

    Name string

    Name of the resource.

    NamePrefix string

    Name prefix as an alternative to name and adds random suffix at the end.

    PolicyDocument string

    Policy Document for lambda.

    ScheduleConfig 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

    UrlConfig FunctionUrl

    Configure lambda function url.

    ImageUri string

    Image uri of the docker image.

    Architecture string

    Architecture, either X86_64 or ARM64. Defaults to X86_64

    Description string

    Description of the function.

    Environment map[string]string

    Environment Variables

    KeepWarm bool

    Keep warm by refreshing the lambda function every 5 minutes. Defaults to false

    LogRetentionInDays int

    Number of days for log retention to pass in cloudwatch log group. Defaults to 90

    MemorySize int

    Amount of memory in MB your Lambda Function can use at runtime. Defaults to 512.

    Name string

    Name of the resource.

    NamePrefix string

    Name prefix as an alternative to name and adds random suffix at the end.

    PolicyDocument string

    Policy Document for lambda.

    ScheduleConfig FunctionScheduleArgs

    Configure the function's cloudwatch event rule schedule.

    Timeout int

    Amount of time your Lambda Function has to run in seconds. Defaults to 3

    UrlConfig FunctionUrlArgs

    Configure lambda function url.

    imageUri String

    Image uri of the docker image.

    architecture String

    Architecture, either X86_64 or ARM64. Defaults to X86_64

    description String

    Description of the function.

    environment Map<String,String>

    Environment Variables

    keepWarm Boolean

    Keep warm by refreshing the lambda function every 5 minutes. Defaults to false

    logRetentionInDays Integer

    Number of days for log retention to pass in cloudwatch log group. Defaults to 90

    memorySize Integer

    Amount of memory in MB your Lambda Function can use at runtime. Defaults to 512.

    name String

    Name of the resource.

    namePrefix String

    Name prefix as an alternative to name and adds random suffix at the end.

    policyDocument String

    Policy Document for lambda.

    scheduleConfig 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

    urlConfig FunctionUrl

    Configure lambda function url.

    imageUri string

    Image uri of the docker image.

    architecture string

    Architecture, either X86_64 or ARM64. Defaults to X86_64

    description string

    Description of the function.

    environment {[key: string]: string}

    Environment Variables

    keepWarm boolean

    Keep warm by refreshing the lambda function every 5 minutes. Defaults to false

    logRetentionInDays number

    Number of days for log retention to pass in cloudwatch log group. Defaults to 90

    memorySize number

    Amount of memory in MB your Lambda Function can use at runtime. Defaults to 512.

    name string

    Name of the resource.

    namePrefix string

    Name prefix as an alternative to name and adds random suffix at the end.

    policyDocument string

    Policy Document for lambda.

    scheduleConfig 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

    urlConfig FunctionUrl

    Configure lambda function url.

    image_uri str

    Image uri of the docker image.

    architecture str

    Architecture, either X86_64 or ARM64. Defaults to X86_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_in_days int

    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 FunctionScheduleArgs

    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 FunctionUrlArgs

    Configure lambda function url.

    imageUri String

    Image uri of the docker image.

    architecture String

    Architecture, either X86_64 or ARM64. Defaults to X86_64

    description String

    Description of the function.

    environment Map<String>

    Environment Variables

    keepWarm Boolean

    Keep warm by refreshing the lambda function every 5 minutes. Defaults to false

    logRetentionInDays Number

    Number of days for log retention to pass in cloudwatch log group. Defaults to 90

    memorySize Number

    Amount of memory in MB your Lambda Function can use at runtime. Defaults to 512.

    name String

    Name of the resource.

    namePrefix String

    Name prefix as an alternative to name and adds random suffix at the end.

    policyDocument String

    Policy Document for lambda.

    scheduleConfig 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

    urlConfig 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:

    Arn string

    ARN (Amazon Resource Name) of the Lambda Function.

    Url string

    Lambda Function URL (Only valid if urlEnabled is used).

    Arn string

    ARN (Amazon Resource Name) of the Lambda Function.

    Url string

    Lambda Function URL (Only valid if urlEnabled is used).

    arn String

    ARN (Amazon Resource Name) of the Lambda Function.

    url String

    Lambda Function URL (Only valid if urlEnabled is used).

    arn string

    ARN (Amazon Resource Name) of the Lambda Function.

    url string

    Lambda Function URL (Only valid if urlEnabled is used).

    arn str

    ARN (Amazon Resource Name) of the Lambda Function.

    url str

    Lambda Function URL (Only valid if urlEnabled is used).

    arn String

    ARN (Amazon Resource Name) of the Lambda Function.

    url String

    Lambda Function URL (Only valid if urlEnabled is used).

    Supporting Types

    FunctionSchedule, FunctionScheduleArgs

    ScheduleExpression string

    Expression for creating a cloudwatch event rule.

    ScheduleInput Dictionary<string, string>

    Input for cloudwatch event target.

    ScheduleExpression string

    Expression for creating a cloudwatch event rule.

    ScheduleInput map[string]string

    Input for cloudwatch event target.

    scheduleExpression String

    Expression for creating a cloudwatch event rule.

    scheduleInput Map<String,String>

    Input for cloudwatch event target.

    scheduleExpression string

    Expression for creating a cloudwatch event rule.

    scheduleInput {[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.

    scheduleExpression String

    Expression for creating a cloudwatch event rule.

    scheduleInput Map<String>

    Input for cloudwatch event target.

    FunctionUrl, FunctionUrlArgs

    CorsConfiguration Pulumi.Aws.Lambda.Inputs.FunctionUrlCors

    CORS Configuration.

    UrlEnabled bool

    Use Lambda URL. Defaults to false

    CorsConfiguration FunctionUrlCors

    CORS Configuration.

    UrlEnabled bool

    Use Lambda URL. Defaults to false

    corsConfiguration FunctionUrlCors

    CORS Configuration.

    urlEnabled Boolean

    Use Lambda URL. Defaults to false

    corsConfiguration pulumiAws.types.input.lambda.FunctionUrlCors

    CORS Configuration.

    urlEnabled boolean

    Use Lambda URL. Defaults to false

    cors_configuration FunctionUrlCorsArgs

    CORS Configuration.

    url_enabled bool

    Use Lambda URL. Defaults to false

    corsConfiguration Property Map

    CORS Configuration.

    urlEnabled Boolean

    Use Lambda URL. Defaults to false

    Package Details

    Repository
    nuage
    License
    Apache-2.0
    nuage logo
    nuage v0.1.1 published on Friday, Mar 17, 2023 by Nuage-Studio