This repository was archived by the owner on May 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
This repository was archived by the owner on May 1, 2020. It is now read-only.
remove() is not removing an AppSync API #15
Copy link
Copy link
Open
Description
I have the following serverless.js for a POC, that will create a dynamodb table for storing posts and an AppSync API for creating a post and getting all posts -
const { Component } = require('@serverless/core');
class ServerlessTemplate extends Component {
async default(inputs) {
inputs.env = inputs.env || 'dev';
const template = await this.load('@serverless/template', inputs.env);
return await template({
template: {
name: inputs.name,
postsTable: {
component: '@serverless/aws-dynamodb',
inputs: {
name: `posts-${inputs.env}`,
region: 'eu-west-1'
}
},
appSync: {
component: '@serverless/aws-app-sync',
inputs: {
name: `posts-api-${inputs.env}`,
region: 'eu-west-1',
authenticationType: 'API_KEY',
apiKeys: ['myApiKey'],
dataSources: [{
type: 'AMAZON_DYNAMODB',
name: 'Posts',
config: {
tableName: `posts-${inputs.env}`
}
}],
mappingTemplates: [{
dataSource: 'Posts',
type: 'Mutation',
field: 'addPost',
request: 'addPostRequest.vtl',
response: 'addPostResponse.vtl'
}, {
dataSource: 'Posts',
type: 'Query',
field: 'posts',
request: 'getAllPostsRequest.vtl',
response: 'getAllPostsResponse.vtl'
}]
}
}
}
});
}
async remove(inputs) {
inputs.env = inputs.env || 'dev';
const template = await this.load('@serverless/template', inputs.env);
console.log(template);
await template.remove();
return {};
}
}
module.exports = ServerlessTemplate;
sls --env dev will create the resources correctly - however running sls remove --env dev will only remove the dynamodb table, but not the AppSync API. Not sure if this is a bug or if I have missed something in my config?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels