Created
August 3, 2018 06:20
-
-
Save honnuanand/6c62f8e13f1134da9b0432d0750347fc to your computer and use it in GitHub Desktop.
Azure Terraform storage initialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anand@Azure:~$ #### Create Resource Group ##### | |
anand@Azure:~$ az group create --name "araoc2sterraform" --location "WestUS" | |
{ | |
"id": "/subscriptions/1da11b37-d598-4c13-8523-690756fd00ab/resourceGroups/araoc2sterraform", | |
"location": "westus", | |
"managedBy": null, | |
"name": "araoc2sterraform", | |
"properties": { | |
"provisioningState": "Succeeded" | |
}, | |
"tags": null | |
} | |
anand@Azure:~$ ##### Create Storage Acount ##### | |
anand@Azure:~$ az storage account create --name "araoc2sterraform" --resource-group "araoc2sterraform" --location "WestUS" --sku "Standard_LRS" | |
{ | |
"accessTier": null, | |
"creationTime": "2018-08-03T06:16:16.450870+00:00", | |
"customDomain": null, | |
"enableHttpsTrafficOnly": false, | |
"encryption": { | |
"keySource": "Microsoft.Storage", | |
"keyVaultProperties": null, | |
"services": { | |
"blob": { | |
"enabled": true, | |
"lastEnabledTime": "2018-08-03T06:16:16.638389+00:00" | |
}, | |
"file": { | |
"enabled": true, | |
"lastEnabledTime": "2018-08-03T06:16:16.638389+00:00" | |
}, | |
"queue": null, | |
"table": null | |
} | |
}, | |
"id": "/subscriptions/1da11b37-d598-4c13-8523-690756fd00ab/resourceGroups/araoc2sterraform/providers/Microsoft.Storage/storageAccounts/araoc2sterraform", | |
"identity": null, | |
"kind": "Storage", | |
"lastGeoFailoverTime": null, | |
"location": "westus", | |
"name": "araoc2sterraform", | |
"networkRuleSet": { | |
"bypass": "AzureServices", | |
"defaultAction": "Allow", | |
"ipRules": [], | |
"virtualNetworkRules": [] | |
}, | |
"primaryEndpoints": { | |
"blob": "https://araoc2sterraform.blob.core.windows.net/", | |
"file": "https://araoc2sterraform.file.core.windows.net/", | |
"queue": "https://araoc2sterraform.queue.core.windows.net/", | |
"table": "https://araoc2sterraform.table.core.windows.net/" | |
}, | |
"primaryLocation": "westus", | |
"provisioningState": "Succeeded", | |
"resourceGroup": "araoc2sterraform", | |
"secondaryEndpoints": null, | |
"secondaryLocation": null, | |
"sku": { | |
"capabilities": null, | |
"kind": null, | |
"locations": null, | |
"name": "Standard_LRS", | |
"resourceType": null, | |
"restrictions": null, | |
"tier": "Standard" | |
}, | |
"statusOfPrimary": "available", | |
"statusOfSecondary": null, | |
"tags": {}, | |
"type": "Microsoft.Storage/storageAccounts" | |
} | |
######Export Azure Account Key ####### | |
anand@Azure:~$ AZURE_ACCOUNT_KEY=$(az storage account keys list --account-name araoc2sterraform --resource-group araoc2sterraform | jq -r .[0].value) | |
###### Create Storage Container ####### | |
anand@Azure:~$ az storage container create --name terraformstate --account-name araoc2sterraform | |
{ | |
"created": true | |
} | |
anand@Azure:~$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment