Skip to content

register_domain

register_domain(
    name: DomainName,
    workflow_execution_retention_period_in_days: DurationInDays,
    *,
    config_overrides: Optional[SWFClientConfig] = None,
    description: Optional[Description] = None,
    tags: Optional[ResourceTagList] = None,
) -> None

Registers a new domain.

Access Control

You can use IAM policies to control this action's access to Amazon SWF resources as follows:

  • You cannot use an IAM policy to control domain access for this action. The name of the domain being registered is available as the resource of this action.

  • Use an Action element to allow or deny permission to call this action.

  • You cannot use an IAM policy to constrain this action's parameters.

If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.

Parameters:

  • name (DomainName) –

    Name of the domain to register. The name must be unique in the region that the domain is registered in.

    The specified string must not start or end with whitespace. It must not contain a : (colon), / (slash), | (vertical bar), or any control characters (\u0000-\u001f | \u007f-\u009f). Also, it must not be the literal string arn.

  • description (Optional[Description], default: None ) –

    A text description of the domain.

  • workflow_execution_retention_period_in_days (DurationInDays) –

    The duration (in days) that records and histories of workflow executions on the domain should be kept by the service. After the retention period, the workflow execution isn't available in the results of visibility calls.

    If you pass the value NONE or 0 (zero), then the workflow execution history isn't retained. As soon as the workflow execution completes, the execution record and its history are deleted.

    The maximum workflow execution retention period is 90 days. For more information about Amazon SWF service limits, see: Amazon SWF Service Limits in the Amazon SWF Developer Guide.

  • tags (Optional[ResourceTagList], default: None ) –

    Tags to be added when registering a domain.

    Tags may only contain unicode letters, digits, whitespace, or these symbols: _ . : / = + - @.

Raises:

  • DomainAlreadyExistsFault –

    Returned if the domain already exists. You may get this fault if you are registering a domain that is either already registered or deprecated, or if you undeprecate a domain that is currently registered.

  • LimitExceededFault –

    Returned by any operation if a system imposed limitation has been reached. To address this fault you should either clean up unused resources or increase the limit by contacting AWS.

  • OperationNotPermittedFault –

    Returned when the caller doesn't have sufficient permissions to invoke the action.

  • TooManyTagsFault –

    You've exceeded the number of tags allowed for a domain.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_swf/_services/swf.py
def register_domain(
    self,
    name: "capo_swf.types.domain_name.DomainName",
    workflow_execution_retention_period_in_days: "capo_swf.types.duration_in_days.DurationInDays",
    *,
    config_overrides: Optional[SWFClientConfig] = None,
    description: Optional["capo_swf.types.description.Description"] = None,
    tags: Optional["capo_swf.types.resource_tag_list.ResourceTagList"] = None,
) -> None:
    r"""<p>Registers a new domain.</p> <p> <b>Access Control</b> </p> <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p> <ul> <li> <p>You cannot use an IAM policy to control domain access for this action. The name of the domain being registered is available as the resource of this action.</p> </li> <li> <p>Use an <code>Action</code> element to allow or deny permission to call this action.</p> </li> <li> <p>You cannot use an IAM policy to constrain this action's parameters.</p> </li> </ul> <p>If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's <code>cause</code> parameter is set to <code>OPERATION_NOT_PERMITTED</code>. For details and example IAM policies, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>

    Args:
        name: <p>Name of the domain to register. The name must be unique in the region that the domain is registered in.</p> <p>The specified string must not start or end with whitespace. It must not contain a <code>:</code> (colon), <code>/</code> (slash), <code>|</code> (vertical bar), or any control characters (<code>\u0000-\u001f</code> | <code>\u007f-\u009f</code>). Also, it must <i>not</i> be the literal string <code>arn</code>.</p>
        description: <p>A text description of the domain.</p>
        workflow_execution_retention_period_in_days: <p>The duration (in days) that records and histories of workflow executions on the domain should be kept by the service. After the retention period, the workflow execution isn't available in the results of visibility calls.</p> <p>If you pass the value <code>NONE</code> or <code>0</code> (zero), then the workflow execution history isn't retained. As soon as the workflow execution completes, the execution record and its history are deleted.</p> <p>The maximum workflow execution retention period is 90 days. For more information about Amazon SWF service limits, see: <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dg-limits.html">Amazon SWF Service Limits</a> in the <i>Amazon SWF Developer Guide</i>.</p>
        tags: <p>Tags to be added when registering a domain.</p> <p>Tags may only contain unicode letters, digits, whitespace, or these symbols: <code>_ . : / = + - @</code>.</p>

    Raises:
        capo_swf.errors.domain_already_exists_fault.DomainAlreadyExistsFault: <p>Returned if the domain already exists. You may get this fault if you are registering a domain that is either already registered or deprecated, or if you undeprecate a domain that is currently registered.</p>
        capo_swf.errors.limit_exceeded_fault.LimitExceededFault: <p>Returned by any operation if a system imposed limitation has been reached. To address this fault you should either clean up unused resources or increase the limit by contacting AWS.</p>
        capo_swf.errors.operation_not_permitted_fault.OperationNotPermittedFault: <p>Returned when the caller doesn't have sufficient permissions to invoke the action.</p>
        capo_swf.errors.too_many_tags_fault.TooManyTagsFault: <p>You've exceeded the number of tags allowed for a domain.</p>
        capo_swf.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_swf.types.register_domain_input.RegisterDomainInput]",
    ) -> OperationResponse[None]:
        import capo_swf._operations.simple_workflow_service.register_domain

        output, http_response = (
            capo_swf._operations.simple_workflow_service.register_domain.register_domain(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterDomain")
    )
    input_: capo_swf.types.register_domain_input.RegisterDomainInput = {
        "name": name,
        "workflow_execution_retention_period_in_days": workflow_execution_retention_period_in_days,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output