version: 1
kind: component

lifecycle:
  verbs:
  - deploy
  - undeploy

parameters:
- name: azure
  parameters:
  - name: resourceGroupName
    env: TF_VAR_resource_group_name
  - name: location
    env: TF_VAR_location 
  - name: storageAccount
    parameters:
    - name: name
      env: TF_VAR_name
    - name: accountTier
      value: Standard
      env: TF_VAR_account_tier
    - name: accessTier
      value: Hot
      env: TF_VAR_access_tier
    - name: accountReplicationType
      value: LRS
      env: TF_VAR_account_replication_type   
    - name: accountKind
      value: StorageV2
      env: TF_VAR_account_kind
    - name: defaultContainerName
      value: default
      env: TF_VAR_default_container_name
    - name: defaultContainerAccessType
      value: private
      env: TF_VAR_default_container_access_type

outputs:
- name: azure.storageAccount.containerName
  value: ${azure.storageAccount.defaultContainerName}
- name: azure.storageAccount.accessKey
  fromTfVar: sensitive_storage_account_primary_access_key                    
