Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when deploying--invalid subnets #16

Open
mlfarrelly opened this issue Dec 30, 2018 · 2 comments
Open

Error when deploying--invalid subnets #16

mlfarrelly opened this issue Dec 30, 2018 · 2 comments

Comments

@mlfarrelly
Copy link

Really enjoying the book, but when I try to deploy, I keep getting this error message:

Error message:

An error occurred: RDSSubnetGroup - Some input subnets in :[subnet-04cb33f4001924f59, subnet-084fb5fd9987a0cf7] are invalid. (Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterValue; Request ID: 60ac3262-5b4c-43b8-b924-7043d6299e62).

I've tried manually creating new VPCs and subnets per the AWS docs, but nothing is working for me.

Any thoughts? Thanks!

@brianz
Copy link
Owner

brianz commented Dec 31, 2018

Hi @mwebdev1

Thanks for this, I'll take a look. Which chapter's code were you seeing this error?

@mlfarrelly
Copy link
Author

Thanks for this, I'll take a look. Which chapter's code were you seeing this error?

Chapter 2. I'm getting the error when I try to deploy with a yml file based off of yours:

`functions:
createuser:
handler: api/handlers.createuser
events:
- http:
path: /createuser
method: post
cors: true
getuser:
handler: api/handlers.getuser
events:
- http:
path: /getuser/{id}
method: get
cors: true

plugins:

  • serverless-offline

resources:
Resources:
ServerlessSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: SecurityGroup for Serverless Functions
VpcId: ${file(./config/config.${self:provider.stage}.json):VPC_ID}
RDSSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Ingress for RDS Instance
VpcId: ${file(./config/config.${self:provider.stage}.json):VPC_ID}
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: '5432'
ToPort: '5432'
SourceSecurityGroupId:
Ref: ServerlessSecurityGroup
RDSSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
Properties:
DBSubnetGroupDescription: RDS Subnet Group
SubnetIds:
- ${file(./config/config.${self:provider.stage}.json):SUBNET_ID_A}
- ${file(./config/config.${self:provider.stage}.json):SUBNET_ID_B}
RDSPostgresInstance:
Type: AWS::RDS::DBInstance
Properties:
AllocatedStorage: 100
AutoMinorVersionUpgrade: true
AvailabilityZone: us-west-2a
DBInstanceClass: db.t2.micro
DBName: ${file(./config/config.${self:provider.stage}.json):DATABASE}
DBSubnetGroupName:
Ref: RDSSubnetGroup
Engine: postgres
EngineVersion: 9.6.2
MasterUsername: ${file(./config/config.${self:provider.stage}.json):USER}
MasterUserPassword: ${file(./config/config.${self:provider.stage}.json):DB_PASSWORD}
PubliclyAccessible: false
VPCSecurityGroups:
- Fn::GetAtt: RDSSecurityGroup.GroupId`

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants