I have an EC2 instance in region EU-CENTRAL-1 which runs a docker image. The docker image needs to be able to send an sms via SNS in region EU-WEST-1.
As of my understanding the instance should by default be able to access the internet outside with a security group letting all outbound communication through. But do i have to setup something to allow the the instance access to SNS in Ireland?
I'm using the following code, but AWS responds as if i used SNS in EU-CENTRAL-1 region where SMS is not available.
// Setup AWS SNS
AWS.config.update({
region: 'eu-west-1',
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
});
var sns = new AWS.SNS();
var params = {
Message: "SMS message test",
MessageStructure: 'string',
PhoneNumber: '0045xxxxxxxx',
Subject: 'Alarm',
MessageAttributes :{
'AWS.SNS.SMS.SenderID': {
'DataType': 'String',
'StringValue': 'MySender'
},
'AWS.SNS.SMS.SMSType': 'Transactional'
}
};