aws-amplify / aws-amplify/amplify-cli

Add "amplify add pubsub" resource to use AWS IoT as pubsub backend

Open
#5,730 1 comment 0 reactions 0 assignees View on GitHub
feature-request p4
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

>**Note**: If your feature-request is regarding the AWS Amplify Console service, please log it in the
[official AWS Amplify Console forum](https://forums.aws.amazon.com/forum.jspa?forumID=314&start=0)

**Is your feature request related to a problem? Please describe.**

When using the Amplify PubSub library with AWS IoT, there are several manual steps we need to perform (e.g. create an IoT policy, look up our user's federated identity and run a CLI command to attach the policy to the user, manually look up our account / region-specific AWS IoT endpoint and hardcode into the configuration of the PubSub module).

This is manual and time consuming. I'd like to see a way to do this in an automated fashion.

**Describe the solution you'd like**

Ideally, I'd like to see an `amplify add pubsub` command added to the CLI that provides a guided walkthrough (or framework for configuring) the pubsub module.

For example, a question that asks "do you want to use AWS IoT as your pubsub broker?" and if user says yes, the module will:

1. Look up the AWS IoT endpoint and add to `aws-exports.js`
2. Create a local file defining an IoT policy to attach to Federated Identities; the policy definition can later be customized (sort of like the groups feature in Auth module)
3. Attach the policy to federated identities

**Describe alternatives you've considered**

Right now, I could add a custom CloudFormation resource type to my amplify project to define the IoT policy.
However, this does not address attaching it to my users or how to lookup and dynamically embed the proper IoT endpoint into my code when running PubSub.AddPluggable.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.