|« PreviousNext »|
|Did this page help you? Yes | No | Tell us about it...|
This section discusses the prerequisites for developing with the Amazon Simple Workflow Service (Amazon SWF), the development options that are available, and how to use Amazon SWF in conjunction with AWS Identity and Access Management (IAM). The first step in using any AWS service is to sign up for an AWS account, discussed in detail in the following section. Once your account is set up, you have the option of developing for Amazon SWF in any of the programming languages supported by AWS. For Java developers, the AWS Flow Framework is also available. AWS Identity and Access Management enables you to grant individuals other than the AWS account owner access to Amazon SWF resources.
To access Amazon SWF, you will need to sign up for an AWS account.
To sign up for an AWS account
Go to http://aws.amazon.com, and then click Sign Up Now.
Follow the on-screen instructions.
Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone keypad.
AWS sends you a confirmation email after the sign-up process is complete. To view your current account activity and manage your account at any time, go to http://aws.amazon.com, and then click My Account/Console.
When you sign up, AWS provides you with security credentials that are specific to your account. Examples of these credentials are shown here.
Access Key ID Example: AKIAIOSFODNN7EXAMPLE
Secret Access Key Example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
To view your AWS access credentials
Go to the Amazon Web Services website at http://aws.amazon.com.
Click My Account/Console, and then click Security Credentials.
Under Your Account, click Security Credentials.
In the spaces provided, type your user name and password, and then click Sign in using our secure server.
Under Access Credentials, on the Access Keys tab, your access key ID is displayed. To view your secret key, under Secret Access Key, click Show.
Your secret key is known only by you and AWS. Keep it confidential in order to protect your account. Store it securely in a safe place, and never email it to anyone. Do not share it outside your organization, even if an inquiry appears to come from AWS or Amazon.com. No one who legitimately represents Amazon will ever ask you for your secret key.
You have a number of options for implementing solutions in the Amazon Simple Workflow Service.
HTTP Service API
As with most AWS offerings, Amazon SWF provides service operations that are accessible through HTTP requests. You can use these operations to communicate directly with Amazon SWF, and you can use them to develop your own libraries in any language that can communicate with Amazon SWF through HTTP.
You can develop deciders, activity workers, or workflow starters by using the service API. You can also access visibility operations through the API to develop your own monitoring and reporting tools.
For information about how to use the API, see Making HTTP Requests to Amazon SWF For detailed information about API operations, go to the http://docs.aws.amazon.com/amazonswf/latest/apireference/Welcome.html.
Amazon SWF provides client libraries for Java, Microsoft .NET, PHP, and Ruby. These libraries provide complete service API functionality. You can develop deciders, activities, or workflow starters using the API exposed by these libraries. Additionally, you can access visibility operations through these libraries so you can develop your own monitoring and reporting tools.
To download an SDK, go to http://aws.amazon.com/code.
For detailed reference information, review the language-specific reference documentation that accompanies the library you are using.
The samples directory that accompanies the AWS SDK for Java contains a number of Amazon SWF samples.
AWS Flow Framework
The AWS Flow Framework is an enhanced SDK for writing distributed, asynchronous programs that can run as workflows on Amazon SWF. It is available for the Java programming language and provides Java interface definitions and classes that simplify writing complex distributed programs.
With the AWS Flow Framework, you use Java interfaces to map the definition of your workflow directly to methods in your Java program.
The AWS Flow Framework supports standard Java object-oriented concepts, such as exception-based error handling, which makes it easier to implement complex workflows. Programs written with the AWS Flow Framework can be created, executed, and debugged entirely within your preferred Java IDE. For more information, see the AWS Flow Framework Developer Guide.
You will need to set up a development environment appropriate to the programming language that you will use. For example, if you intend to develop for Amazon SWF with Java, you will need to install a Java development environment, such as the AWS SDK for Java, on each of your development workstations. If you use the Eclipse IDE for Java development, you might consider also installing the AWS Toolkit for Eclipse. The Toolkit is an Eclipse plug-in that adds features that are helpful for AWS development.
If your programming language requires a run-time environment, you need to set up that environment on each computer on which these processes run.
To reduce latency and to store data in a location that meets your requirements, Amazon SWF provides endpoints in different regions.
Each endpoint is entirely independent. For example, if you have two workflows called "MyWorkflow," one in swf.us-east-1.amazonaws.com and one in swf.eu-west-1.amazonaws.com, they are completely independent and do not share any data. For a list of Amazon SWF endpoints, see Regions and Endpoints.