0.1.2 • Published 4 years ago
graphboss-cli v0.1.2
graphboss cli
Usage
$ npm install -g graphboss-cli
$ graphboss COMMAND
running command...
$ graphboss (-v|--version|version)
graphboss-cli/0.1.2 darwin-x64 node-v12.13.0
$ graphboss --help [COMMAND]
USAGE
$ graphboss COMMAND
...
Commands
graphboss amplify
Generate a CloudFormation stack from the GraphQL schema using the AWS Amplify code generator
USAGE
$ graphboss amplify
OPTIONS
-c, --config=config config file (default: "graphboss.json")
-d, --dest=dest destination folder to generate output into (default: "generated")
-f, --force
-h, --help show CLI help
-s, --schema=schema graphql schema file (default: "schema.graphql")
EXAMPLE
$ graphboss amplify --config=graphboss.json --dest=generated --schema=schema.graphql --force
Config File
The config file is JSON object with the Amplify authConfig
settings.
{
"authConfig": {
"defaultAuthentication": AppSyncAuthConfigurationEntry,
"additionalAuthenticationProviders": [AppSyncAuthConfigurationEntry] // optional
}
}
The value for AppSyncAuthConfigurationEntry
depends on the authenticationType
.
API_KEY
{
"authenticationType": "API_KEY",
"apiKeyConfig": {
"description": "API Key Description", // optional
"apiKeyExpirationDays": 365
}
}
AMAZON_COGNITO_USER_POOLS
{
"authenticationType": "AMAZON_COGNITO_USER_POOLS"
}
You will need to override the AuthCognitoUserPoolId
stack parameter when deploying to set the Cognito User Pool ID.
AWS_IAM
{
"authenticationType": "AWS_IAM"
}
OPENID_CONNECT
{
"authenticationType": "OPENID_CONNECT",
"openIDConnectConfig": {
"name": "Name",
"issuerUrl": "Issuer URL",
"clientId": "Client ID", // optional
"iatTTL": number, // optional
"authTTL": number // optional
}
}
Usage
After generating the output you can package and deploy using stacks/template.yaml
from the output folder. For example:
> rm -rf generated && graphboss amplify
> cd generated/stacks
> aws cloudformation package --template-file template.yaml --output-template-file packaged.yaml --s3-bucket piiq-deploy-us-west-2-dev --profile <YOUR AWS PROFILE NAME> --region <AWS REGION>
> aws cloudformation deploy --template-file packaged.yaml --stack-name <YOUR STACK NAME> --capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_NAMED_IAM --profile <YOUR AWS PROFILE NAME> --region <AWS REGION>
See code: src/commands/amplify.ts
graphboss help [COMMAND]
display help for graphboss
USAGE
$ graphboss help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help