sites¶
All site definitions.
identifier
- (Required)
Unique identifier for this site.
Will be used for the Terraform state and naming all cloud resources.endpoints
- Endpoint definitions to be used in the API Gateway or Frontdoor routingcommercetools
- commercetools configuration blocksentry
- Sentry configuration blockcontentful
- Contentful configuration blockazure
- Azure settingsaws
- AWS settingscomponents
- Component configurations
endpoints¶
Endpoint definitions to be used in the API Gateway or Frontdoor routing.
Each component might require a different endpoint. In the component definition it can be defined which endpoint it expects. The actual endpoint can be defined here using the unique key.
Example:
endpoints:
main: api.tst.mach-example.net
services: services.tst.mach-example.net
Azure support
At the moment, this option is not supported when using Azure and simply ignored.
For Azure, the endpoints that are created for the APIs are constructed by using the commercetools project key as DNS record. More on that in the Azure routing section
commercetools¶
commercetools configuration.
Example:
commercetools:
project_key: my-site-tst
client_id: T9J5g5bJe-VV8aVvN5Q
client_secret: FIo3PGHJDThCM17wok_irLakRzCA
scopes: manage_api_clients:my-site-tst manage_project:my-site-tst view_api_clients:my-site-tst
languages:
- en-GB
- nl-NL
currencies:
- GBP
- EUR
countries:
- GB
- NL
project_key
- (Required) commercetools project keyclient_id
- (Required) API client IDclient_secret
- (Required) API client secretscopes
- (Required) Required scopes for given API client ID.currencies
- (Required) List of three-digit currency codes as per ISO 4217languages
- (Required) List of IETF language tagcountries
- (Required) List of two-digit country codes as per ISO 3166-1 alpha-2token_url
- Defaults tohttps://auth.europe-west1.gcp.commercetools.com
api_url
- Defaults tohttps://api.europe-west1.gcp.commercetools.com
messages_enabled
- When false the creation of messages is disabled.
Defaults to Truechannels
- List of channel definitionstaxes
- List of tax definitionsstores
- List of store definitions if multiple (store) contexts are going to be used.create_frontend_credentials
- Defines if frontend API credentials must be created Defaults totrue
channels¶
Example
channels:
- key: INV
roles:
- InventorySupply
name:
en-GB: Inventory
description:
en-GB: Our main inventory channel
- key: DIST
roles:
- ProductDistribution
name:
en-GB: Distribution
description:
en-GB: Our main distribution channel
key
- (Required)roles
- (Required) List of channel roles.
Can be one ofInventorySupply
,ProductDistribution
,OrderExport
,OrderImport
orPrimary
name
- Name of the channel. Localized string 1description
- Description of the channel. Localized string 1
taxes¶
Defines tax rates for various countries.
country
- (Required) A two-digit country code as per ISO 3166-1 alpha-2amount
- (Required) Number Percentage in the range of [0..1]name
- (Required) Tax rate name
stores¶
Defines commercetools stores.
Example:
stores:
- name:
en-GB: my store
key: mystore
distribution_channels:
- EU-DIST
supply_channels:
- EU-SUPPL
name
- (Required) Name of the store. Localized string 1key
- (Required) Store keylanguages
- List of languagesdistribution_channels
- List of supply channel keys used for product projection store filteringsupply_channels
- List of supply channel keys used for product projection store filtering
sentry¶
Overwrites any value specified in the general configs Sentry block
dsn
- DSN to use in the componentsrate_limit_window
- The rate limit window that applies to a generated keyrate_limit_count
- The rate limit count that applies to a generated key
contentful¶
Contentful configuration.
Example:
contentful:
space: "MySpace"
space
- (Required) Name of the space to be createddefault_locale
- Set default locale. Defaults to "en-US"cma_token
- Override defaultcma_token
setting (site-specific)organization_id
- Override defaultorganization_id
setting (site-specific)
amplience¶
Amplience configuration.
Example:
client_id
- Overrides defaultclient_id
settings (site-specific)client_secret
- Override defaultclient_secret
setting (site-specific)hub_id
- Override defaulthub_id
setting (site-specific)
azure¶
Site-specific Azure settings.
Can overwrite any value from the generic Azure settings:
tenant_id
service_object_ids
frontdoor
subscription_id
region
And adds the following exta attributes:
alert_group
- List of Alert groupsresource_group
- Name of an already existing resource group.
Warning
Use resource_group
with care.
By default, MACH will manage the site resource groups for you. If you add this option later, the managed resource group will get deleted.
So only use for new site definitions
alert_group¶
Example:
alert_group:
name: critical
alert_emails:
- alerting@example.com
logic_app: my-shared-we-rg.my-shared-we-alerts-slack
webhook_url: https://example.com/api/alert-me/
name
- (Required) The name of the alert groupalert_emails
- Hook alert group to these email addresseswebhook_url
- Hooks alert group to a webhooklogic_app
- Reference to a Logic App the alert group needs to be connected to.
Format is<resource_group>.<logic_app_name>
aws¶
Site-specific AWS settings.
Example:
aws:
account_id: 1234567890
region: eu-west-1
deploy_role_arn: deploy
extra_providers:
- name: email
region: eu-west-1
account_id
- (Required) AWS account ID for this siteregion
- AWS region to deploy site indeploy_role_arn
- The IAM role ARN needed for deploymentextra_providers
Component configurations¶
Configures the components for the site. The must reference a defined component (defined in the component definitions)
Example:
components:
- name: api-extensions
variables:
ORDER_PREFIX: mysitetst
- name: order-mailer
variables:
FROM_EMAIL: mach@example.com
secrets:
SENDGRID_API_KEY: my-api-token
store_variables:
brand-a:
FROM_EMAIL: mach@brand-a.com
other-brand:
FROM_EMAIL: mach@other-brand.com
name
- (Required) Reference to a component definitionvariables
- Variables for this componentsecrets
- Variables for this component that should be stored in a encrypted key-value storestore_variables
- commercetools store-specific variables for this componentstore_secrets
- commercetools store-specific variables for this component that should be stored in a encrypted key-value storehealth_check_path
- Defines a custom healthcheck path.
Overwrites the defaulthealth_check_path
defined in the component definitionsentry
- Sentry configuration block
sentry¶
Overwrites any value specified in the site configs Sentry block
dsn
- DSN to use in the componentsrate_limit_window
- The rate limit window that applies to a generated keyrate_limit_count
- The rate limit count that applies to a generated key
-
commercetools uses Localized strings to be able to define strings in mulitple languages.
Whenever a localized string needs to be defined, this can be done in the following format:↩↩↩some-string: - en-GB: My value - nl-NL: Mijn waarde