From 1bbfede8eec1018b20cf694e1f4484267f9d07ec Mon Sep 17 00:00:00 2001 From: Ryan Cartwright Date: Fri, 6 Sep 2024 12:07:36 +1000 Subject: [PATCH 1/2] add description config --- src/pages/apis.mdx | 50 +++++++++++++++++-- .../reference/providers/aws/configuration.mdx | 6 +-- .../providers/azure/configuration.mdx | 12 +++-- .../reference/providers/gcp/configuration.mdx | 12 +++-- 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/src/pages/apis.mdx b/src/pages/apis.mdx index 76979c080..3eeb3db26 100644 --- a/src/pages/apis.mdx +++ b/src/pages/apis.mdx @@ -766,8 +766,7 @@ By default APIs deployed by Nitric will be assigned a domain by the target cloud -```yaml {{ title: "AWS", tag: "nitric-prod.yaml (stack file)" }} -name: my-aws-stack +```yaml {{ title: "AWS", tag: "nitric.prod.yaml" }} provider: nitric/aws@1.1.0 region: ap-southeast-2 @@ -780,14 +779,57 @@ apis: - test.example.com ``` -```yaml {{ title: "Azure", tag: "nitric-prod.yaml (stack file)" }} +```yaml {{ title: "Azure", tag: "nitric.prod.yaml (stack file)" }} # currently unsupported - request support here: https://github.com/nitrictech/nitric/issues ``` -```yaml {{ title: "Google Cloud", tag: "nitric-prod.yaml (stack file)" }} +```yaml {{ title: "Google Cloud", tag: "nitric.prod.yaml (stack file)" }} # currently unsupported - request support here: https://github.com/nitrictech/nitric/issues ``` +## Custom Descriptions + +By default, APIs will not be deployed with a description. You can add a description using the following configuration in your stack file. + + + +```yaml {{ title: "AWS", tag: "nitric.prod.yaml" }} +provider: nitric/aws@1.12.4 +region: ap-southeast-2 + +# Add a key for configuring apis +apis: + # Target an API by its nitric name + my-api-name: + # provide domains to be used for the api + description: An AWS API +``` + +```yaml {{ title: "Azure", tag: "nitric.prod.yaml" }} +provider: nitric/azure@1.12.4 +region: Australia East +org: example-org +adminemail: test@example.com + +apis: + # Target an API by its nitric name + my-api-name: + # provide domains to be used for the api + description: An Azure API +``` + +```yaml {{ title: "Google Cloud", tag: "nitric.prod.yaml" }} +provider: nitric/gcp@1.12.4 +region: australia-southeast1 + +# Add a key for configuring apis +apis: + # Target an API by its nitric name + my-api-name: + # provide domains to be used for the api + description: A GCP API +``` + ### AWS Custom Domain Prerequisites diff --git a/src/pages/reference/providers/aws/configuration.mdx b/src/pages/reference/providers/aws/configuration.mdx index 4a57f4979..9338f94e3 100644 --- a/src/pages/reference/providers/aws/configuration.mdx +++ b/src/pages/reference/providers/aws/configuration.mdx @@ -7,13 +7,10 @@ export const description = 'Configuring your AWS stacks' ```yaml {{ title: "Pulumi" }} -# The name of your AWS stack -name: my-aws-stack-name - # The provider to use and it's published version # See releases: # https://github.com/nitrictech/nitric/tags -provider: nitric/aws@1.1.0 +provider: nitric/aws@1.12.4 # The target aws region to deploy to # See available regions: @@ -47,6 +44,7 @@ apis: # The domain or parent domain must have a hosted zone already in Route53 domains: - api.example.com + description: An AWS API # Configure your deployed services config: diff --git a/src/pages/reference/providers/azure/configuration.mdx b/src/pages/reference/providers/azure/configuration.mdx index 2dcefcbaf..358bb8ee3 100644 --- a/src/pages/reference/providers/azure/configuration.mdx +++ b/src/pages/reference/providers/azure/configuration.mdx @@ -5,13 +5,10 @@ export const description = 'Configuring your Azure stacks' # Complete Example with comments ```yaml -# The name of your Azure stack -name: my-azure-stack-name - # The provider to use and it's published version # See releases: # https://github.com/nitrictech/nitric/tags -provider: nitric/azure@1.0.0 +provider: nitric/azure@1.12.4 # The target Azure region to deploy to # See available regions: @@ -31,6 +28,13 @@ adminemail: test@example.com # All configuration below is optional +# Apply configuration to nitric APIs +apis: + # Target an API by its nitric name + my-api: + # provide domains to be used for the api + description: An Azure API + # Configure your deployed services config: # How services without a type will be deployed diff --git a/src/pages/reference/providers/gcp/configuration.mdx b/src/pages/reference/providers/gcp/configuration.mdx index 828b3f9de..6df960867 100644 --- a/src/pages/reference/providers/gcp/configuration.mdx +++ b/src/pages/reference/providers/gcp/configuration.mdx @@ -7,13 +7,10 @@ export const description = 'Configuring your Google Cloud stacks' ```yaml {{ title: "Pulumi" }} -# The name of your GCP stack -name: my-gcp-stack-name - # The provider to use and it's published version # See releases: # https://github.com/nitrictech/nitric/tags -provider: nitric/gcp@1.10.0 +provider: nitric/gcp@1.12.4 # The target GCP region to deploy to # See available regions: @@ -41,6 +38,13 @@ import: # const mySecret = secret('my-secret'); my-secret: existing-secret +# Apply configuration to nitric APIs +apis: + # Target an API by its nitric name + my-api: + # provide domains to be used for the api + description: An Azure API + # Configure your deployed services config: # How services without a type will be deployed From 5db53736a54a2b3aa9ff5b9b543bb28313252f7b Mon Sep 17 00:00:00 2001 From: Ryan Cartwright Date: Fri, 6 Sep 2024 12:09:06 +1000 Subject: [PATCH 2/2] add missing code group tag --- src/pages/apis.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/apis.mdx b/src/pages/apis.mdx index 3eeb3db26..b80dc3218 100644 --- a/src/pages/apis.mdx +++ b/src/pages/apis.mdx @@ -779,14 +779,16 @@ apis: - test.example.com ``` -```yaml {{ title: "Azure", tag: "nitric.prod.yaml (stack file)" }} +```yaml {{ title: "Azure", tag: "nitric.prod.yaml" }} # currently unsupported - request support here: https://github.com/nitrictech/nitric/issues ``` -```yaml {{ title: "Google Cloud", tag: "nitric.prod.yaml (stack file)" }} +```yaml {{ title: "Google Cloud", tag: "nitric.prod.yaml" }} # currently unsupported - request support here: https://github.com/nitrictech/nitric/issues ``` + + ## Custom Descriptions By default, APIs will not be deployed with a description. You can add a description using the following configuration in your stack file.