Azure Storage Sync
This page shows how to write Terraform and Azure Resource Manager for Storage Sync and write them securely.
azurerm_storage_sync (Terraform)
The Sync in Storage can be configured in Terraform with the resource name azurerm_storage_sync
. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_storage_sync" "sync" {
#depends_on = [azurerm_resource_provider_registration.storage_sync]
name = local.resource_storage_sync_name
resource_group_name = module.resource_group.name
location = module.resource_group.location
}
Parameters
-
id
optional computed - string -
incoming_traffic_policy
optional - string -
location
required - string -
name
required - string -
resource_group_name
required - string -
tags
optional - map from string to string -
timeouts
single block
Explanation in Terraform Registry
Manages a Storage Sync.
Tips: Best Practices for The Other Azure Storage Resources
In addition to the azurerm_storage_account, Azure Storage has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
azurerm_storage_account
Ensure to use HTTPS connections
It is better to use HTTPS instead of HTTP, which could be vulnerable to person-in-the-middle attacks.
azurerm_storage_account_network_rules
Ensure to allow Trusted Microsoft Services to bypass
It is better to allow Trusted Microsoft Services to bypass. They are not able to access storage account unless rules are set to allow them explicitly.
Microsoft.StorageSync/storageSyncServices (Azure Resource Manager)
The storageSyncServices in Microsoft.StorageSync can be configured in Azure Resource Manager with the resource name Microsoft.StorageSync/storageSyncServices
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworks_file_server_onp_name": {
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
Parameters
apiVersion
required - stringlocation
required - stringRequired. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.
name
required - stringName of Storage Sync Service resource.
properties
requiredincomingTrafficPolicy
optional - stringIncoming Traffic Policy.
tags
optional - stringGets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.
type
required - string
Frequently asked questions
What is Azure Storage Sync?
Azure Storage Sync is a resource for Storage of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Storage Sync?
For Terraform, the wesley-trust/Terraform source code example is useful. See the Terraform Example section for further details.
For Azure Resource Manager, the kohei3110/file-server-on-azure, HasanIftakher/Azure-Monitor and mydur/AzMon source code examples are useful. See the Azure Resource Manager Example section for further details.