runway.cfngin.hooks.staticsite.auth_at_edge.domain_updater module

User Pool Client Domain Updater.

pydantic model runway.cfngin.hooks.staticsite.auth_at_edge.domain_updater.HookArgs[source]

Bases: HookArgsBaseModel

Hook arguments.

Show JSON schema
{
   "title": "HookArgs",
   "description": "Hook arguments.",
   "type": "object",
   "properties": {
      "tags": {
         "additionalProperties": {
            "type": "string"
         },
         "default": {},
         "title": "Tags",
         "type": "object"
      },
      "client_id": {
         "title": "Client Id",
         "type": "string"
      }
   },
   "required": [
      "client_id"
   ]
}

field client_id: str = PydanticUndefined

The ID of the Cognito User Pool Client.

runway.cfngin.hooks.staticsite.auth_at_edge.domain_updater.delete(context: runway.context.CfnginContext, *_args: Any, **kwargs: Any) dict[str, Any] | bool[source]

Delete the domain if the user pool was created by Runway.

If a User Pool was created by Runway, and populated with a domain, that domain must be deleted prior to the User Pool itself being deleted or an error will occur. This process ensures that our generated domain name is deleted, or skips if not able to find one.

Arguments parsed by HookArgs.

Parameters:
  • context – The context instance.

  • **kwargs – Arbitrary keyword arguments.

runway.cfngin.hooks.staticsite.auth_at_edge.domain_updater.get_user_pool_domain(prefix: str, region: str) str[source]

Return a user pool domain name based on the prefix received and region.

Parameters:
  • prefix – The domain prefix for the domain.

  • region – The region in which the pool resides.

runway.cfngin.hooks.staticsite.auth_at_edge.domain_updater.update(context: runway.context.CfnginContext, *_args: Any, **kwargs: Any) dict[str, Any] | bool[source]

Retrieve/Update the domain name of the specified client.

A domain name is required in order to make authorization and token requests. This prehook ensures we have one available, and if not we create one based on the user pool and client ids.

Arguments parsed by HookArgs.

Parameters:
  • context – The context instance.

  • **kwargs – Arbitrary keyword arguments.