aws-sns | Amazon SNS Notifications Channel for Laravel | AWS library
kandi X-RAY | aws-sns Summary
kandi X-RAY | aws-sns Summary
Amazon SNS Notifications Channel for Laravel 5.3
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Send a notification .
- Configure the sms .
- Bind SNS Client .
- Get SNSClient instance .
- Set message structure
- Set the message .
- Register the module .
- Register the AWS SNS configs .
- Thrown when a service failed .
aws-sns Key Features
aws-sns Examples and Code Snippets
Community Discussions
Trending Discussions on aws-sns
QUESTION
I recently set up an application on AWS via CDK. The application consists of a Dockerized nodejs application, which connects to an RDS instance, and has a Redis caching layer as well. After having the application deployed for a few days, the costs are much higher than I had anticipated, even with minimal traffic. After looking through the cost explorer, it looks like half of the cost is coming from the NAT gateways.
In my current setup, I have created two VPCs. One is used for the application stack, and the other is for the CodePipeline. I needed to add one for the pipeline because without it I was hitting rate limits when trying to pull Docker images during the CodeBuildAction steps.
I'm not very comfortable with the networking bits, but I feel like there are extra resources involved. The pipeline VPC has three NAT gateways and three EIPs. These end up just sitting there waiting for the next deployment, which seems like a huge waste. It seems like a new gateway + EIP is allocated for each construct the VPC is attached to in CDK. Can I just make it reuse the same one? Is there an alternative to adding a VPC at all and not getting rate limited by Docker?
I also find it very surprising (I might just be naive) that the NAT gateway is so far equally as expensive as my current Fargate task costs. Is there an alternative that would serve my purposes, but come at a little lower cost?
Anyways, here are my two stacks:
...ANSWER
Answered 2022-Feb-11 at 11:08I would strongly advise moving from the Docker directory to ECR public gallery to avoid ratelimit issues: https://gallery.ecr.aws/
That said, to answer the question about the number of NATs created. As you can see in the CDK docs, what you're seeing reflects the default behavior (emphasis mine):
A VPC consists of one or more subnets that instances can be placed into. CDK distinguishes three different subnet types:
Public (SubnetType.PUBLIC) - public subnets connect directly to the Internet using an Internet Gateway. If you want your instances to have a public IP address and be directly reachable from the Internet, you must place them in a public subnet.
Private with Internet Access (SubnetType.PRIVATE_WITH_NAT) - instances in private subnets are not directly routable from the Internet, and connect out to the Internet via a NAT gateway. By default, a NAT gateway is created in every public subnet for maximum availability. Be aware that you will be charged for NAT gateways.
Isolated (SubnetType.PRIVATE_ISOLATED) - isolated subnets do not route from or to the Internet, and as such do not require NAT gateways. They can only connect to or be connected to from other instances in the same VPC. A default VPC configuration will not include isolated subnets,
A default VPC configuration will create public and private subnets. However, if natGateways:0 and subnetConfiguration is undefined, default VPC configuration will create public and isolated subnets.
So a separate NAT is created for every Public subnet.
Also, the docs for the natGateways
parameter mentioned above also describe the default behavior:
(default: One NAT gateway/instance per Availability Zone)
To limit the number of AZs used by the VPC, specify the maxAzs
parameter. Set it to 1 to only have a single NAT per VPC.
If you're fine with making the resources in the VPC publicly reachable from the internet, you can place them in Public subnets and avoid the creation of NATs altogether.
QUESTION
I use CDK to deploy a codepipeline. It works fine until I try to add notification for codepipeline success/fail events. It gives CREATE_FAILED
error with message Resource handler returned message: "Invalid request provided: AWS::CodeStarNotifications::NotificationRule" (RequestToken: bb566fd0-1ac9-5d61-03fe-f9c27b4196fa, HandlerErrorCode: InvalidRequest)
. What could be the reason? Thanks.
ANSWER
Answered 2022-Feb-09 at 09:02This is because imported resources cannot be modified. As you pointed out in the comments, setting up the notification involves modifying the Topic resource, specifically its access policy.
Reference: https://docs.aws.amazon.com/cdk/v2/guide/resources.html#resources_importing
QUESTION
I've been working on a project which so far has just involved building some cloud infrastructure, and now I'm trying to add a CLI to simplify running some AWS Lambdas. Unfortunately both the sdist and wheel packages built using poetry build
don't seem to include the dependencies, so I have to manually pip install
all of them to run the command. Basically I
- run
poetry build
in the project, cd "$(mktemp --directory)"
,python -m venv .venv
,. .venv/bin/activate
,pip install /path/to/result/of/poetry/build/above
, and then- run the new .venv/bin/ executable.
At this point the executable fails, because pip
did not install any of the package dependencies. If I pip show PACKAGE
the Requires
line is empty.
The Poetry manual doesn't seem to specify how to link dependencies to the built package, so what do I have to do instead?
I am using some optional dependencies, could that be interfering with the build process? To be clear, even non-optional dependencies do not show up in the package dependencies.
pyproject.toml:
...ANSWER
Answered 2021-Nov-04 at 02:15This appears to be a bug in Poetry. Or at least it's not clear from the documentation what the expected behavior would be in a case such as yours.
In your pyproject.toml
, you specify two dependencies as required in this section:
QUESTION
I'm having a very hard time trying to understand how to mirror the native Terraform module instantiation structure I am used to in Terragrunt. Take the below Terraform structure that creates different instances of a sns topic module.
...ANSWER
Answered 2021-Oct-23 at 17:43(Disclaimer: what is below just represents my understanding & workflow, which might not be definitive :) )
My understanding is that whilst you can write native Terraform in the top level module, best practice is to move this to another module, called from the terraform
block in your terragrunt.hcl
file. This module acts as an orchestration layer. I think the idea is that the top levels of a Terragrunt project likely represent things where you broadly want the same resources in each (for example dev, test, prod) and so the use of this orchestration module allows you to DRY that code up, rather than duplicate it between the top level directories.
Therefore in your case, I think you would need to write a module that looked a little like this and would be called from your terragrunt.hcl
file:
top_level/main.tf
QUESTION
I have a CDK app that uses a lambda function to check for changes to the content of a website. I want that SMS to be sent to a mobile number if the change is detected.
In my AWS CDK project, I created my stack, that builds the lambda function and the SNS
file: lib/lambda_query_website_aws_cdk-stack.ts
...ANSWER
Answered 2021-Sep-22 at 00:59Try something like this
QUESTION
I am trying to use one of our internal generated java library by JSII from Typescript aws-cdk-library project.
when we try to invoke and on cdk synth
we are getting below error
software.amazon.jsii.JsiiException: Module '@company/cdk-tags' not found Error: Module '@company/cdk-tags' not found
Currently we are using cdk version 1.106.0
, java 13 and maven 3.6.
here is our package.json and module-package.json
package.json
...ANSWER
Answered 2021-Jul-07 at 13:59Finally we are able to solve this issue. This was due to multiple modules with same java package structure names. This created a conflict in loading and finding the module when running from java.
After changing the package structure, it started working fine.
We have multiple modules like cloudwatch and nodejs-canary inside a main project.
Before
package.json for cloudwatch
"jsii": { "outdir": "dist", "targets": { "java": { "package": "com.company.common.aws.cdk", "maven": { "groupId": "com.company.common.aws.cdk", "artifactId": "cloudwatch" } } } }
package.json for nodejs-canary
"jsii": { "outdir": "dist", "targets": { "java": { "package": "com.company.common.aws.cdk", "maven": { "groupId": "com.company.common.aws.cdk", "artifactId": "nodejs-canary" } } } }
After
"jsii": { "outdir": "dist", "targets": { "java": { "package": "com.company.common.aws.cdk.cloudwatch", "maven": { "groupId": "com.company.common.aws.cdk", "artifactId": "cloudwatch" } } } }
package.json
"jsii": { "outdir": "dist", "targets": { "java": { "package": "com.company.common.aws.cdk.nodejs_canary", "maven": { "groupId": "com.company.common.aws.cdk", "artifactId": "nodejs-canary" } } } }
Just to add little more, initially when we ran with one module it worked fine. Later after adding additional modules while using in Java we got Module not found error.
QUESTION
I've done a code to send SMS to specific phone number using java which uses AWS-SNS API's it works fine but i just wanted to verify if the message has been delivered or not. for example : say if the mobile number is wrong or does not exist like +910000000000
below is my code
...ANSWER
Answered 2021-Mar-24 at 08:24You can use the Cloudwatch Logs service as mentioned in this AWS document.
QUESTION
Several different questions have been asked on how to subscribe an SQS FIFO queue to an SNS topic and their answers were "it's impossible" or, more recently, "it's now possible using an SNS FIFO topic".
This question is a bit more specific in its premises:
- Using an SNS FIFO topic is not a viable option, it has to be a "standard" topic
- Using a "standard" SQS queue is not a viable option, it has to be a FIFO queue
As of time of writing, AWS does not support a direct subscription.
How to achieve it in the next best way possible? Using an AWS Lambda? EventBridge?
...ANSWER
Answered 2021-Mar-23 at 23:56As you said, this is currently not possible through direct subscription. A work around to achieve that is to subscribe a lambda to the standard topic and have that lambda sending to the FIFO Queue. It's not ideal since it adds an extra hop, but it does unblock your use-case
QUESTION
I have an app released recently with new pages and I want to send push notifications (which points to those new pages) to only those users having the latest app version(4.1.1).
I am using AWS-SNS to push notifications from backend code(ruby on rails)
Can anyone please tell me how we could achieve this?
...ANSWER
Answered 2021-Mar-11 at 07:49Amazon SNS service doesn't have capability to detect endpoints (i.e users using a particular app version). Therefore, I would like to refer you to another AWS service called Amazon Pinpoint which from my research supports this use-case.
In summary, when using Amazon Pinpoint service with your app and users install the app Amazon Pinpoint creates endpoints (i.e a repository of audience data). This data consists of:
- Any custom attributes or metrics that you record.
- Demographics. See sample illustration below:
Using the sample demographics data as shown above you can do the following :
- Create Segment that include users using app version(x.x.x). See sample illustration below:
- Create a push notification Campaign that a targets the Segment created above.
QUESTION
I am working on sending OTP messages for user login leveraging Amazon SNS. I am able to send Text message as suggesting here. For the email notification as well I would like to use a similar approach. But looks like for email notifications, a topic has to be created in SNS and a subscriber has to be created for each email id registered in the application.
Is it not possible to send email to mail-id dynamically as done for text messages without creating topics and subscribers? If not please suggest a way to set email id dynamically based on the user logged in.
Code for Text Messaging:
...ANSWER
Answered 2020-Dec-24 at 10:26Correct.
Amazon SNS normally uses a Public/Subscribe model for messages.
The one exception is the ability to send an SMS message to a specific recipient.
If you wish to send an email to a single recipient, you will need to use your own SMTP server, or use Amazon Simple Email Service (Amazon SES).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aws-sns
Follow the Amazon Console generate the APIKEY and API SECRET, which is connecting both.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page