awslambda.S3Bucket

Dedicated lookup for use with AwsLambdaHook based hooks.

Important

This lookup does not support arguments. Any arguments passed to the lookup directly will be discarded.

Note

To use this lookup during development, it must be manually registered in the CFNgin configuration file. To simplify this, registering awslambda_lookup.AwsLambdaLookup registers all related lookups.

Example
lookups:
  awslambda: awslambda_lookup.AwsLambdaLookup

To use this hook, there must be a AwsLambdaHook based hook defined in the pre_deploy section of the CFNgin configuration file. This hook must also define a data_key that is unique within the CFNgin configuration file (it can be reused in other CFNgin configuration files). The data_key is then passed to the lookup as it’s input/query. This allows the lookup to function during a runway plan.

A string is returned by this lookup. The returned value can be passed directly to AWS::Lambda::Function.Code.S3Bucket or AWS::Lambda::LayerVersion.Content.S3Bucket.

Example

namespace: example
cfngin_bucket: ''
sys_path: ./

lookups:
  awslambda: awslambda_lookup.AwsLambdaLookup

pre_deploy:
  - path: awslambda.PythonFunction
    data_key: example-function-01
    args:
      ...
  - path: awslambda.PythonFunction
    data_key: example-function-02
    args:
      ...

stacks:
  - name: example-stack-01
    class_path: blueprints.FooStack
    variables:
      S3Bucket: ${awslambda.S3Bucket example-function-01}
      ...
  - name: example-stack-02
    template_path: ./templates/bar-stack.yml
    variables:
      S3Bucket: ${awslambda.S3Bucket example-function-02}
      ...