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 blockapollo_federation
- Apollo Federation 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.
Basic example:
endpoints:
main: api.tst.mach-example.net
services: services.tst.mach-example.net
Complex example:
endpoints:
internal:
url: internal-api.tst.mach-example.net
zone: tst.mach-example.net
aws:
throttling_burst_limit: 5000
throttling_rate_limit: 10000
enable_cdn: true
url
- (Required) url of the endpointzone
- DNS zone to use, if missing it's determined based on the givenurl
aws
- Configuration block for AWS-specific settingsazure
- Configuration block for Azure-specific settings
aws¶
Example:
aws:
throttling_burst_limit: 5000
throttling_rate_limit: 10000
enable_cdn: true
throttling_burst_limit
- Set burst limit for API Gateway endpointsthrottling_rate_limit
- Set burst limit for API Gateway endpointsenable_cdn
- Defaults to false. Sets a CDN in front of this endpoint for better global availability. For AWS creates a CloudFront distribution
azure¶
Example:
azure:
session_affinity_enabled: True
session_affinity_ttl_seconds: 3600
waf_policy_id: "string"
session_affinity_enabled
- Whether to allow session affinity on this hostsession_affinity_ttl_seconds
- The TTL to use in seconds for session affinity, if applicable.waf_policy_id
- Defines the Web Application Firewall policyID
for the host.
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
project_key
- (Required) commercetools project keyclient_id
- (Required) API client IDclient_secret
- (Required) API client secretscopes
- (Required) Required scopes for given API client ID.project_settings
- Project settings configuration blocktoken_url
- Defaults tohttps://auth.europe-west1.gcp.commercetools.com
api_url
- Defaults tohttps://api.europe-west1.gcp.commercetools.com
channels
- List of channel definitionstaxes
- List of tax definitionstax_categories
- List of tax_category definitionszones
- List of zone definitionsstores
- List of store definitions if multiple (store) contexts are going to be used.frontend
- Frontend configuration block
project_settings¶
Configuration block to define project settings.
Example:
project_settings:
languages:
- en-GB
- nl-NL
currencies:
- GBP
- EUR
countries:
- GB
- NL
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-2messages_enabled
- When false the creation of messages is disabled.
Defaults to True
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
zones¶
Defines shipping zones.
Example:
zones:
- name: US zone 1
locations:
- country: US
state: Nevada
- name: US zone 2
locations:
- country: US
- name: CA
locations:
- country: CA
- name: Benelux
locations:
- country: NL
- country: BE
- country: LU
name
- (Required) Name for the zonelocations
- List of locations that are part of this zonedescription
- Zone description
locations¶
country
- (Required) Two-digit country codes as per ISO 3166-1 alpha-2state
- State
taxes¶
Defines tax rates for various countries but will only create a single tax category. Please see tax_categories for setups demanding multiple tax categories.
Cannot be used in conjunction with tax_categories
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 nameincluded_in_price
- Tax included in price
tax_categories¶
Defines commercetools tax categories with commercetools tax rates.
Cannot be used in conjunction with taxes
Example:
tax_categories:
- name: Non-standard taxes
key: non-standard-taxes
rates:
- name: rate 2
amount: 0.02
country: GB
included_in_price: false
- name: rate 10
amount: 0.1
country: NL
included_in_price: true
- name: Standard taxes
key: some-standard
rates:
- name: rate 21
amount: 0.21
country: GB
- name: rate 6
amount: 0.06
country: NL
name
- (Required) Name of the categorykey
- (Required) Key of the categoryrates
- List of tax rates
stores¶
Defines commercetools stores.
Example:
stores:
- key: mystore
name:
en-GB: my store
distribution_channels:
- EU-DIST
supply_channels:
- EU-SUPPL
stores:
- key: mystore
managed: false
- key: our-other-store
managed: false
- key: global-store
managed: false
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 filteringmanaged
- Indicate whether this store should be managed by MACH or not. Default totrue
frontend¶
Warning
This functionality is deprecated and will be removed soon.
Create your own frontend tokens in the commercetools Merchant Center. Once this functionality is removed the generated frontend tokens will be automatically deleted on rollout.
Example:
frontend:
create_credentials: true
permission_scopes: [manage_my_profile, manage_my_orders, view_states, manage_my_shopping_lists, view_products, manage_my_payments, create_anonymous_token, view_project_settings]
create_credentials
- Defines if frontend API credentials must be created Defaults totrue
permission_scopes
- List of scopes excluding the project key
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
- (Required) Overrides defaultclient_id
settings (site-specific)client_secret
- (Required) Override defaultclient_secret
setting (site-specific)hub_id
- (Required) Override defaulthub_id
setting (site-specific)
apollo_federation¶
Apollo Federation configuration.
Example:
apollo_federation:
api_key: service:mach-poc-123:Abc00kHbB89h
graph: mach-poc-123
graph_variant: current
api_key
- Apollo Studio API keygraph
- Graph name to use for this sitegraph_variant
- Graph variant
azure¶
Site-specific Azure settings.
Can overwrite any value from the generic Azure settings:
tenant_id
- Tenant to deploy inservice_object_ids
frontdoor
- Front-door settingssubscription_id
- Subscription to deploy inregion
- Azure region to deploy inservice_plans
- Map of custom service plan configurations
And adds the following extra 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
frontdoor¶
Example:
frontdoor:
resource_group: my-shared-rg
ssl_key_vault:
name: mysharedwekvcerts
resource_group: my-shared-we-rg
secret_name: my-domain-net
dns_resource_group
- (Required) Resource group name where the DNS zone can be foundsuppress_changes
- Suppress changes to the Frontdoor instance. This is a temporary work-around for some issues in the Azure Terraform provider.ssl_key_vault
- SSL certificate configuration when Frontdoor should use your own certificate
ssl_key_vault¶
name
- (Required) KeyVault nameresource_group
- (Required) KeyVault resource groupsecret_name
- (Required) Certificate name
service_plans¶
Map of service plan definitions if you want to define additional service plans your components should run on, or if you want to overwrite the default.
Example:
# Here we add an additional service plan 'premium'
service_plans:
premium:
kind: "Linux"
tier: "PremiumV2"
size: "P2v2"
capacity: 2
# Here we configure the default service plan to run Premium
# and also offer a service plan running Windows
service_plans:
default:
kind: "Linux"
tier: "PremiumV2"
size: "P2v2"
windows:
kind: "Windows"
tier: "PremiumV2"
size: "P2v2"
kind
- (Required) The kind of the App Service Plan to create.Windows
,Linux
,elastic
orFunctionApp
.tier
- (Required) Specifies the plan's pricing tier.size
- (Required) Specifies the plan's instance size.capacity
- Specifies the number of workers associated with this App Service Plan.dedicated_resource_group
- Indicates of the service plan should run on a dedicated resource group. This might be useful when, due to Azure hosting restrictions, a service plan cannot run on the same resource group as an existing one. Defaults tofalse
.per_site_scaling
- Can Apps assigned to this App Service Plan be scaled independently? If set tofalse
apps assigned to this plan will scale to all instances of the plan. Defaults tofalse
.
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_name: deploy
default_tags:
owner: terraform
extra_providers:
- name: email
region: eu-west-1
account_id
- (Required) AWS account ID for this siteregion
- AWS region to deploy site indeploy_role_name
- The IAM role name needed for deploymentdefault_tags
- Default tags set at provider levelextra_providers
components¶
Configures the components for the site. They 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 an 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 an encrypted key-value storehealth_check_path
- Defines a custom healthcheck path.
Overwrites the defaulthealth_check_path
defined in the component definitionsentry
- Sentry configuration blockazure
- Azure 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
azure¶
Overwrites any value specified in the component definition.
Example:
azure:
service_plan: default
service_plan
- The service plan (defined inservice_plans
) to use for this component. Set this todefault
if you want to use the MACH-managed Consumption plan.
-
commercetools uses Localized strings to be able to define strings in multiple 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