-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add safebox schema * add safebox schema * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4611681
commit 3ee949c
Showing
4 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"additionalProperties": false, | ||
"description": "Configuration for safebox to deploy parameters to various parameter stores", | ||
"properties": { | ||
"service": { | ||
"type": "string", | ||
"description": "Name of the service. parameters will be prefixed by the value provided" | ||
}, | ||
"provider": { | ||
"type": "string", | ||
"enum": ["ssm", "secrets-manager"], | ||
"description": "Deploy parameters to the given provider. Eg. ssm, secrets-manager" | ||
}, | ||
"prefix": { | ||
"type": "string", | ||
"description": "Prefix to apply to all parameters. Does not apply for shared", | ||
"default": "/<stage>/<service>/" | ||
}, | ||
"generate": { | ||
"type": "array", | ||
"description": "Generate different files based on the parameter name and values", | ||
"items": { | ||
"type": "object", | ||
"required": ["type", "path"], | ||
"properties": { | ||
"type": { | ||
"enum": ["json", "yaml", "dotenv", "types-node"], | ||
"description": "Type of file to generate" | ||
}, | ||
"path": { | ||
"type": "string", | ||
"description": "Full path with filename for writing the output" | ||
} | ||
} | ||
} | ||
}, | ||
"cloudformation-stacks": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "Cloudformation stack names. Any output values from the stacks can be interpolated. Eg. DB_NAME: \"{{.myDbName}}\"\nmyDbName is the output of one of the cloudformation stacks" | ||
}, | ||
"config": { | ||
"type": "object", | ||
"description": "Parameters to deploy as non secret. You can also specify stage specific key value pairs. Same key in the defaults will be ignored and stage specific value will be used.", | ||
"properties": { | ||
"defaults": { | ||
"type": "object", | ||
"description": "parameter name and value. Output is /<stage>/<service>/<param name>" | ||
}, | ||
"shared": { | ||
"type": "object", | ||
"description": "Params that are to be shared between multiple services. The parameter name wont be prefixed by service name. Output is /<stage>/shared/<param name>" | ||
} | ||
} | ||
}, | ||
"secret": { | ||
"type": "object", | ||
"description": "Parameters to deploy as secret. You cannot specify stage specific key value pairs. Value is the description. You will need to run safebox deploy in prompt mode to provide the actual value.", | ||
"properties": { | ||
"defaults": { | ||
"type": "object", | ||
"description": "parameter name and value. Output is /<stage>/<service>/<param name>" | ||
}, | ||
"shared": { | ||
"type": "object", | ||
"description": "Params that are to be shared between multiple services. The parameter name wont be prefixed by service name. Output is /<stage>/shared/<param name>" | ||
} | ||
} | ||
} | ||
}, | ||
"required": ["service", "provider"], | ||
"type": "object" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
service: safebox | ||
provider: ssm | ||
prefix: '/test/' | ||
|
||
generate: | ||
- type: types-node | ||
path: env.d.ts | ||
- type: dotenv | ||
path: .env | ||
|
||
cloudformation-stacks: | ||
- '{{.stage}}-shared-infra-SharedInfraServerless' | ||
- '{{.stage}}-user-debug-stack' | ||
|
||
config: | ||
defaults: | ||
DB_NAME: 'database name updated' | ||
CF_OUTPUT_API_ENDPOINT: '{{.internalDomainName}}' | ||
NEW: 'endpoint-{{.stage}}' | ||
NEW2: 'endpoint updated' | ||
NEW3: 'endpoint updated' | ||
AWS_REGION: '{{.region}}' | ||
AWS_ACCOUNT: '{{.account}}' | ||
CF_OUTPUT_BUCKET_ARN: '{{.BucketArn}}' | ||
CF_OUTPUT_ENDPOINT: '{{.Endpoint}}' | ||
|
||
prod: | ||
DB_NAME: 'production db name' | ||
|
||
dev: | ||
DB_NAME: 'dev db name' | ||
|
||
shared: | ||
SHARED_KEY: 'shared key' | ||
|
||
secret: | ||
defaults: | ||
API_KEY: 'key of the api endpoint' | ||
DB_SECRET: 'database secret' | ||
|
||
shared: | ||
APOLLO_KEY: 'apollo key' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
service: safebox | ||
provider: ssm | ||
|
||
config: | ||
defaults: | ||
DB_NAME: 'database name updated' | ||
CF_OUTPUT_API_ENDPOINT: '{{.internalDomainName}}' | ||
NEW: 'endpoint-{{.stage}}' | ||
|
||
shared: | ||
SHARED_KEY: 'shared key' | ||
|
||
secret: | ||
defaults: | ||
API_KEY: 'key of the api endpoint' | ||
DB_SECRET: 'database secret' | ||
|
||
shared: | ||
APOLLO_KEY: 'apollo key' |