Skip to main content

B.CfnTwilio

A collection of AWS CDK based Twilio resources.

Description

This library is intended to simplify Twilio Resource management. It helps manage resources such as Activities, TaskQueues, Workflows and Workspaces in an AWS Architecture.

NOTE! In order to use this layer, a docker command must be available on your machine. It is because the CDK runs a bundling command on a docker container to create the Twilio dependency.

Remarks

Biomapas aims to modernise life-science industry by sharing its IT knowledge with other companies and the community. This is an open source library intended to be used by anyone. Improvements and pull requests are welcome.

Related technology

  • Python 3
  • AWS CDK
  • Twilio

Assumptions

The project assumes the following:

  • You have basic-good knowledge in python programming.
  • You have basic-good knowledge in AWS and AWS CDK.
  • You have basic knowledge in Twilio.

Useful sources

Install

The project is built and uploaded to PyPi. Install it by using pip.

pip install b_cfn_twilio

Or directly install it through source.

pip install .

Usage & Examples

Create a Twilio Workspace:

from b_cfn_twilio.cfn_workspace.resource import TwilioWorkspaceResource

workspace = TwilioWorkspaceResource(
    scope=stack,
    name='WorkspaceResource',
    workspace_name='WorkspaceName',
    twilio_account_sid='TWILIO_ACCOUNT_SID',
    twilio_auth_token='TWILIO_AUTH_TOKEN'
)

print(workspace.workspace_sid)

Create a Twilio Workflow:

from b_cfn_twilio.cfn_task_queue.resource import TwilioTaskQueueResource

task_queue = TwilioTaskQueueResource(
    scope=stack,
    name='TaskQueueResource',
    task_queue_name='TaskQueueName',
    twilio_account_sid='TWILIO_ACCOUNT_SID',
    twilio_auth_token='TWILIO_AUTH_TOKEN',
    twilio_workspace_sid=workspace.workspace_sid
)

print(task_queue.task_queue_sid)

Create a Twilio TaskQueue:

from b_cfn_twilio.cfn_workflow.resource import TwilioWorkflowResource

workflow = TwilioWorkflowResource(
    scope=stack,
    name='WorkflowResource',
    workflow_name='Workflow',
    task_queue_sid=task_queue.task_queue_sid,
    twilio_account_sid='TWILIO_ACCOUNT_SID',
    twilio_auth_token='TWILIO_AUTH_TOKEN',
    twilio_workspace_sid=workspace.workspace_sid
)

print(workflow.workflow_sid)

Create Twilio Activities:

from b_cfn_twilio.cfn_activity.resource import TwilioActivityResource
from b_cfn_twilio.cfn_activity.twilio_activity import TwilioActivity

activities = TwilioActivityResource(
    scope=stack,
    name='ActivityResource',
    activities=[
        TwilioActivity('Available', True, False),
        TwilioActivity('Unavailable', False, True)
    ],
    twilio_account_sid='TWILIO_ACCOUNT_SID',
    twilio_auth_token='TWILIO_AUTH_TOKEN',
    twilio_workspace_sid=workspace.workspace_sid
)

print(activities.get_activity_sid('Available'))
print(activities.get_activity_sid('Unavailable'))

Testing

This package has integration tests based on pytest. To run tests simply run:

pytest b_cfn_twilio_test/integration/tests

Contribution

Found a bug? Want to add or suggest a new feature?
Contributions of any kind are gladly welcome. You may contact us directly, create a pull-request or an issue in github platform. Lets modernize the world together.

Release history

1.0.0

  • Initial release.

Metadata

Release files for b-cfn-twilio 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for b-cfn-twilio 1.0.0
File Size Uploaded Provenance
b_cfn_twilio-1.0.0.tar.gz 16.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for b-cfn-twilio 1.0.0
File Interpreter ABI Platform
b_cfn_twilio-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.3 kB

Release files / b_cfn_twilio-1.0.0.tar.gz

Download URL b_cfn_twilio-1.0.0.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c199f879f4da2e83a67373b63b391366270cdf8c514c5d91a70365bead33eb66
BLAKE2b-256 checksum
How to use checksums
f19e3d3cf91fabb06d795f1b7e3618752657dbd7c2b1e8350a55d4e1dafcb2e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / b_cfn_twilio-1.0.0-py3-none-any.whl

Download URL b_cfn_twilio-1.0.0-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98b92ef171e5347e84ed879b704975f9d3c8ad30a146867d2f4497fdb10d5946
BLAKE2b-256 checksum
How to use checksums
5d6281e25b72852692bf1836e6f3e831b8afc1d0f10489d696f778e2a6f638ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Security for b-cfn-twilio 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page