This is an example for a simple stock polling application, that retrieves data from Twelve Data API, stores the latest stock price in DynamoDB and publishes the update to a SQS queue.
It show case the capabilities of Wing to fetch data from an external API and distribute this across different systems.
To extend this example, try making the polling application track five ticket symbols, or try displaying the information using the cloud.Website class
Please make sure to use a current and working setup of the wing cli
As the Scheduler component is only available with the sim
and tf-aws
provider, you do have to compile and then deploy the application.
For more details see also Wing compatability matrix.
wing it
To test the application in the Wing Console, you have to set up a secret at ~/.wing/secrets.json
. For more details refer to Secrets with the Simulator target.
wing compile --target tf-aws main.w
cd target/main.tfaws
For your first deployment you have to initialize Terraform in the working directory:
terraform init
And you also need to create the secret in AWS Secrets Manager, refer also to documentation of cloud.secret
for AWS as target.
aws secretsmanager create-secret --name twelve-data-api-key --secret-string your_api_key
terraform apply