{"id":18904934,"url":"https://github.com/concon121/serverless-plugin-aws-resource-names","last_synced_at":"2025-04-15T04:10:50.604Z","repository":{"id":55637908,"uuid":"109113013","full_name":"concon121/serverless-plugin-aws-resource-names","owner":"concon121","description":"Serverless plugin to enable custom AWS resource names","archived":false,"fork":false,"pushed_at":"2024-02-08T17:05:19.000Z","size":61,"stargazers_count":5,"open_issues_count":8,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-22T13:43:22.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/concon121.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-01T09:35:56.000Z","updated_at":"2021-08-28T02:34:17.000Z","dependencies_parsed_at":"2022-08-15T05:10:28.687Z","dependency_job_id":null,"html_url":"https://github.com/concon121/serverless-plugin-aws-resource-names","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fserverless-plugin-aws-resource-names","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fserverless-plugin-aws-resource-names/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fserverless-plugin-aws-resource-names/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/concon121%2Fserverless-plugin-aws-resource-names/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/concon121","download_url":"https://codeload.github.com/concon121/serverless-plugin-aws-resource-names/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223136851,"owners_count":17093432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T09:09:54.872Z","updated_at":"2024-11-08T09:09:55.443Z","avatar_url":"https://github.com/concon121.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-plugin-aws-resource-names\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n\nServerless plugin to enable custom AWS resource names\n\n## Usage\n\nInstall the plugin to your project:\n\n    npm install serverless-aws-resource-names --save\n\nAdd the plugin and its configuration to your serverless project:\n\n    plugins:\n      - serverless-aws-resource-names\n    custom:\n      serverless-aws-resource-names:\n        source: mapping.json\n\nCreate the `mapping.json` file in your project and modify the names to your hearts desire!\n\n    {\n        \"template\": {\n            \"compiled\": \"cloudformation-template-update-stack.json\",\n            \"core\": \"cloudformation-template-create-stack.json\"\n        },\n        \"stack\": \"$service-$stage\",\n        \"role\": {\n            \"Fn::Join\": [\n                \"-\", [\n                    \"$service\",\n                    \"$stage\",\n                    \"$region\",\n                    \"lambdaRole\"\n                ]\n            ]\n        },\n        \"policy\": {\n            \"Fn::Join\": [\n                \"-\", [\n                    \"$stage\",\n                    \"$service\",\n                    \"lambda\"\n                ]\n            ]\n        },\n        \"apiGateway\": \"$stage-$service\",\n        \"lambda\": \"$service-$stage-$lambda\",\n        \"logGroup\": \"/aws/lambda/$service-$stage-$lambda\"\n    }\n\n### Mapping Variable Reference\n\n-   **$service** - Refers to the service attribute in your serverless.yml\n-   **$stage** - Refers to the stage which you deploy to via serverless e.g. sls deploy **-s dev**\n-   **$region** - Refers to the AWS region that you are deploying to.  This is configured in your serverless.yml under the _provider.region_ attribute or by your AWS CLI configuration.\n-   **$lambda** - Refers to the name of your lambda function, defined in your serverless.yml under the _functions_ attribute.\n-   **$rand** - Globally replaces all instances with a random UUID.\n\n### Custom Variables\n\nYou can define custom variables in your `serverless.yml` file:\n\n    plugins:\n      - serverless-aws-resource-names\n    custom:\n      serverless-aws-resource-names:\n        source: mapping.json\n        variables:\n          functionSuffix: func\n\nAnd then use these custom variables in your `mapping.json` file:\n\n    {\n        \"lambda\": \"$service-$stage-$lambda-$functionSuffix\",\n    }\n\nHere we've defined a custom variable `functionSuffix` and assigned it the value `'func'`.\n\nThis will append the string `'func'` to all of your Lambda function names.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcon121%2Fserverless-plugin-aws-resource-names","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconcon121%2Fserverless-plugin-aws-resource-names","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconcon121%2Fserverless-plugin-aws-resource-names/lists"}