Comments (12)
This is a definite blocker for us moving to v3 as we use EventBridge extensively to decouple.
from ion.
Hi @thdxr, I'm happy to do the implementation of this component. Any specifications that I should follow?
from ion.
Bus is available, it's just undocumented at the moment:
https://github.com/sst/ion/tree/dev/examples/aws-bus
from ion.
Agreed with @jamlen - leverage EventBridge heavily to decouple - would be great to prioritise this.
from ion.
@joshsutheran-habitude It has been implemented already - see the link I posted above
from ion.
What approach there is for referencing the default bus using this component? I tried to follow the import option but it said that it would not let me assign "default" as a name.
from ion.
What approach there is for referencing the default bus using this component? I tried to follow the import option but it said that it would not let me assign "default" as a name.
Hi @ajotaos, maybe because the resources need to start with Capital letters? Try Default
from ion.
No luck sorry, if I do that:
new sst.aws.Bus(prefixComponentName('Default'), {
transform: {
bus: (args, opts) => {
args.name = 'Default' // or even if I omit this line
opts.import = 'default'
}
}
})
The CLI rejects it with:
✕ Failed
ComicbookPagesDefault sst:aws:Bus → ComicbookPagesDefaultBus aws:cloudwatch:EventBus
inputs to import do not match the existing resource
Set the following in your transform:
- `args.name = "default";`
Otherwise if I do this instead:
new sst.aws.Bus(prefixComponentName('Default'), {
transform: {
bus: (args, opts) => {
args.name = 'default'
opts.import = 'default'
}
}
})
The CLI rejects it with:
✕ Failed
ComicbookPagesDefault sst:aws:Bus → ComicbookPagesDefaultBus aws:cloudwatch:EventBus
aws:cloudwatch/eventBus:EventBus resource 'ComicbookPagesDefaultBus' has a problem: invalid value for name (cannot be 'default'). Examine values at 'ComicbookPagesDefaultBus.name'.
from ion.
As this feature isn't fully finished I thought I'd raise a simple issue here when importing partner buses. Because of the long name given to the bus when it's a partner one it breaks the character limit when trying to create the rule and target.
export const shopify = new sst.aws.Bus('Shopify', {
transform: {
bus: (args, opts) => {
args.name = 'aws.partner/shopify.com/XXXXXXXXXX/together-dev-jsutherland'
// opts.import = 'aws.partner/shopify.com/XXXXXXXXX/together-dev-jsutherland'
}
}
})
Failed AwspartnershopifycomXXXXXXXXXXtogetherdevjsutherlandSubscriberHrtotzRule aws:cloudwatch:EventRule could not make instance of 'aws:cloudwatch/eventRule:EventRule': name 'AwspartnershopifycomXXXXXXXXXXtogetherdevjsutherlandSubscriberHrtotzRule-' plus 7 random chars is longer than maximum length 64
Failed AwspartnershopifycomXXXXXXXXXXtogetherdevjsutherlandSubscriberHrtotzTarget aws:cloudwatch:EventTarget aws:cloudwatch/eventTarget:EventTarget resource 'AwspartnershopifycomXXXXXXXXXXtogetherdevjsutherlandSubscriberHrtotzTarget' has a problem: "target_id" cannot be longer than 64 characters: "AwspartnershopifycomXXXXXXXXXXtogetherdevjsutherlandSubscriberHrtotzTarget-e1e5c79". Examine values at 'AwspartnershopifycomXXXXXXXXXXtogetherdevjsutherlandSubscriberHrtotzTarget.targetId'.
This is the workaround below incase anyone else is running into the same issues
// We overwrite the generated rule names when subscribing
// as they are too long when importing a partner event bus.
events.shopify.subscribe('services/upload/src/events.shopify', {
transform: {
rule: (args, opts) => {
args.name = 'new_rule_name'
},
target: (args, opts) => {
args.targetId = 'new_target_id'
}
}
})
from ion.
@joshsutheran-habitude It has been implemented already - see the link I posted above
We are relatively new to SST but use EventBus heavily in v2.
Do you happen to have an example implementation of EventBus in Ion?
We think it makes sense for us to migrate but are hesitant to do so without this being documented.
from ion.
I ended up using the static function of Bus.subscribe and getting the ARN from the pulumi aws module function.
from ion.
@joshsutheran-habitude It has been implemented already - see the link I posted above
We are relatively new to SST but use EventBus heavily in v2. Do you happen to have an example implementation of EventBus in Ion? We think it makes sense for us to migrate but are hesitant to do so without this being documented.
sst.config.ts
https://github.com/sst/ion/blob/3cc1603bba6a1eb8a4a178134450f808fb253ddb/examples/aws-bus/sst.config.ts
I'd recommend adding filters if you have more than one subscriber.
mentioned in #533
from ion.
Related Issues (20)
- Redirects are not supported when DNS is disabled
- Provisioned concurrency for lambda
- Docs: component versioning
- Expo cant bundle with sst HOT 2
- Transform errors | Nuxt | Type 'void' is not assignable to type 'undefined'. HOT 1
- API routes in NextJS don't return any data
- SST state and assets S3 buckets fail AWS Security hub
- Remix/SsrSite: allow cloudFrontFunctions custom injections for serverCfFunction & staticCfFunction
- Default Lambda policies not being managed on changes
- Can't create AWS Lambda router: "The parameter origin name must be a domain name."
- Could not open a new TTY when running sst install
- middleware "error": Routing failed. TypeError: globalThis.__import_unsupported is not a function
- Remix Vite Config Resolution Broken in Monorepos HOT 1
- either 'content' (presen t: true) or 'data' (present: false) must be provided - cloudflare HOT 3
- Unable to get environment variables injected into NextJS Site Deployment
- Menu button on website no longer works for mobile HOT 1
- Outdated Cloudflare DNS Record Args
- Support deployment with lambda@edge
- Specific version installation is not working for 3.0
- Install script redownloads SST on every execution
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ion.