StackParameters class

class cfp.StackParameters(default_resolvers: bool = True)

A list of CloudFormation stack parameters.

Check if a parameter has been added via in:

>>> "foo" in stack_parameters

Get a parameter’s source by querying the key:

>>> stack_parameters["foo"]

Count the added parameters via len:

>>> len(stack_parameters)
Parameters

default_resolvers – Register the default resolvers

add(key: str, source: Union[str, cfp.sources.source.Source]) None

Adds a new stack parameter with direction for finding the value.

Parameters
  • key – Stack parameter key

  • source – Value or source

property api_parameters: List[cfp.types.ApiParameter]

Gets the resolved parameters as a list ready to pass directly to Boto3.

register_resolver(factory: Type[cfp.resolver_factories.resolver_factory.ResolverFactory[Any, Any]]) None

Registers a resolver factory.

Parameters

factory – Factory type

render(writer: IO[str], color: Optional[bool] = None) None

Renders the parameters.

Parameters
  • writer – String writer.

  • color – Emit color. The default None delegates the decision to Ansiscape.