runway.lookups.handlers.cfn module

Retrieve a value from CloudFormation Stack Outputs.

The query syntax for this lookup is <stack-name>.<output-name>. When specifying the output name, be sure to use the Logical ID of the output; not the Export.Name.

class runway.lookups.handlers.cfn.CfnLookup[source]

Bases: LookupHandler[CfnginContext | RunwayContext]

CloudFormation Stack Output lookup.

TYPE_NAME: ClassVar[str] = 'cfn'

Name that the Lookup is registered as.

static get_stack_output(client: CloudFormationClient, query: OutputQuery) str[source]

Get CloudFormation Stack output.

Parameters:
  • client – Boto3 CloudFormation client.

  • query – What to get.

classmethod handle(value: str, context: CfnginContext | RunwayContext, *, provider: Provider | None = None, **_: Any) Any[source]

Retrieve a value from CloudFormation Stack outputs.

Parameters:
  • value – The value passed to the Lookup.

  • context – The current context object.

  • provider – AWS provider.

Returns:

Result of the query.

Raises:

OutputDoesNotExist – Output does not exist on the Stack provided and default was not provided.

static should_use_provider(args: ParsedArgsTypeDef, provider: Provider | None) bool[source]

Determine if the provider should be used for the lookup.

This will open happen when the lookup is used with CFNgin.

Parameters:
  • args – Parsed arguments provided to the lookup.

  • provider – CFNgin provider.

class runway.lookups.handlers.cfn.OutputQuery[source]

Bases: NamedTuple

Output query NamedTuple.

static __new__(_cls, stack_name: str, output_name: str)

Create new instance of OutputQuery(stack_name, output_name)

output_name: str

Alias for field number 1

stack_name: str

Alias for field number 0