Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit ee348c2

Browse files
authored
append stage to stack name (#29)
* append stage to stack name * bump up vertsion
1 parent 3f818fc commit ee348c2

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-plugin-sumologic",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "Serverless plugin to create sumologic stack",
55
"main": "src/index.js",
66
"repository": "https://github.com/ACloudGuru/a-cloud-guru/tree/master/packages/serverless-plugin-sumologic",

src/getConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const getConfig = ({ serverless, options }) => {
1111
const region =
1212
get(options, 'region') || get(serverless, 'service.provider.region');
1313

14-
const name = `sumologic-logs-${get(
14+
const name = `sumologic-${get(
1515
serverless,
1616
'service.custom.sumologic.name'
17-
)}`;
17+
)}-${stage}`;
1818

1919
if (!stage) {
2020
throw new Error('Serverless "stage" is missing');

src/getConfig.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('#getConfig', () => {
2121
expect(config).toEqual({
2222
endpointUrl: userConfig.endpointUrl,
2323
includeLogGroupInfo: false,
24-
name: 'sumologic-logs-my-service',
24+
name: 'sumologic-my-service-test',
2525
region: 'east',
2626
stage: 'test',
2727
});
@@ -50,7 +50,7 @@ describe('#getConfig', () => {
5050
expect(config).toEqual({
5151
...userConfig,
5252
stage: 'test',
53-
name: 'sumologic-logs-my-service',
53+
name: 'sumologic-my-service-test',
5454
region: 'east',
5555
});
5656
});

src/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('#SumologicPlugin', () => {
7070
config: {
7171
endpointUrl: 'endpoint-url',
7272
includeLogGroupInfo: false,
73-
name: 'sumologic-logs-stack-name',
73+
name: 'sumologic-stack-name-test',
7474
region: 'east',
7575
stage: 'test',
7676
},
@@ -85,7 +85,7 @@ describe('#SumologicPlugin', () => {
8585
config: {
8686
endpointUrl: 'endpoint-url',
8787
includeLogGroupInfo: false,
88-
name: 'sumologic-logs-stack-name',
88+
name: 'sumologic-stack-name-test',
8989
region: 'east',
9090
stage: 'test',
9191
},

src/template/getResources.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const getResources = ({ name, stage, prefix }) => ({
184184
],
185185
Properties: {
186186
FunctionName: {
187-
'Fn::Sub': `${name}-sumologic-${stage}`,
187+
'Fn::Sub': name,
188188
},
189189
Code: {
190190
S3Bucket: {

0 commit comments

Comments
 (0)