Work with Amazon SWF domains using the Amazon CLI - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Work with Amazon SWF domains using the Amazon CLI

You can use the Amazon Command Line Interface (Amazon CLI) to manage your Amazon Simple Workflow Service (Amazon SWF) domains.

List your domains

To list the Amazon SWF domains that you have registered for your Amazon account, you can use swf list-domains. You must include --registration-status and specify either REGISTERED or DEPRECATED.

Here's a minimal example.

$ aws swf list-domains --registration-status REGISTERED { "domainInfos": [ { "status": "REGISTERED", "name": "ExampleDomain" }, { "status": "REGISTERED", "name": "mytest" } ] }
Note

For an example of using DEPRECATED, see Deprecate a domain.

For more information, see swf list-domains in the Amazon CLI Command Reference.

Get information about a domain

To get detailed information about a particular domain, use swf describe-domain. There is one required parameter, --name, which takes the name of the domain you want information about, as shown in the following example.

$ aws swf describe-domain --name ExampleDomain { "domainInfo": { "status": "REGISTERED", "name": "ExampleDomain" }, "configuration": { "workflowExecutionRetentionPeriodInDays": "1" } }

For more information, see swf describe-domain in the Amazon CLI Command Reference.

Register a domain

To register new domains, use swf register-domain.

There are two required parameters: --name and --workflow-execution-retention-period-in-days. The --name parameter takes the domain name to register. The --workflow-execution-retention-period-in-days parameter takes an integer to specify the number of days to retain workflow execution data on this domain, up to a maximum period of 90 days (for more information, see the Amazon SWF FAQ).

If you specify zero (0) for this value, the retention period is automatically set at the maximum duration. Otherwise, workflow execution data isn't retained after the specified number of days have passed. The following example shows how to register a new domain.

$ aws swf register-domain --name MyNeatNewDomain --workflow-execution-retention-period-in-days 0

The command doesn't return any output, but you can use swf list-domains or swf describe-domain to see the new domain, as shown in the following example.

$ aws swf describe-domain --name MyNeatNewDomain { "domainInfo": { "status": "REGISTERED", "name": "MyNeatNewDomain" }, "configuration": { "workflowExecutionRetentionPeriodInDays": "0" } }

For more information, see swf register-domain in the Amazon CLI Command Reference.

Deprecate a domain

To deprecate a domain (you can still see it, but cannot create new workflow executions or register types on it), use swf deprecate-domain. It has a sole required parameter, --name, which takes the name of the domain to deprecate.

$ aws swf deprecate-domain --name MyNeatNewDomain

As with register-domain, no output is returned. If you use list-domains to view the registered domains, however, you will see that the domain no longer appears among them. You can also use --registration-status DEPRECATED.

$ aws swf list-domains --registration-status DEPRECATED { "domainInfos": [ { "status": "DEPRECATED", "name": "MyNeatNewDomain" } ] }

For more information, see deprecate-domain in the Amazon CLI Command Reference.