Infrastructure RFID Tag Reading, implemented after Master's Work.
This repository provides the implementation of infrastructure of the projects rfid-reader-middleware, rfid-reader-api and rfid-reader-web.
The infrastructure was organized through modules.
├── src
├── modules (resources)
├── container
├── databases
├── functions
...
├── main.tf (execute modules)
├── outputs.tf (connections)
├── provider.tf (Azure)
...
See the work repository for more details of the project.
- Terraform (Azure Provider)
- Azure CLI
az login
- (Optional) Create service principal credentials for Azure authentication
az ad sp create-for-rbac --name "{NAME}" --role contributor --scopes /subscriptions/{YOUR_AZURE_SUBSCRIPTION_ID}
Result create service principal:
{
"clientId": "{AZURE_CLIENT_ID}",
"clientSecret": "{AZURE_CLIENT_SECRET}",
"subscriptionId": "{AZURE_SUBSCRIPTION_ID}",
"tenantId": "{AZURE_TENANT_ID}",
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
"resourceManagerEndpointUrl": "https://management.azure.com/",
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
"galleryEndpointUrl": "https://gallery.azure.com/",
"managementEndpointUrl": "https://management.core.windows.net/"
}
Use variables clientId, clientSecret, subscriptionId and tenantId in provider:
provider "azurerm" {
version = ">= 2.0.0"
subscription_id = var.subscription_id
client_id = var.client_id
client_secret = var.client_secret
tenant_id = var.tenant_id
features {}
}
In this project the variables are in GitHub Secrets.
- In path src in project root execute desired the commands Terraform
terraform init (install modules and provider)
terraform validate (validate scripts)
terraform apply (apply infrastructure)
terraform destroy (remove infrastructure)
More commands.
Infraestrutura de Leitura de Tags RFID, implementado após trabalho de Mestrado.
Este repositório apresenta a implementação de toda infraestrutura dos projetos rfid-reader-middleware, rfid-reader-api e rfid-reader-web.
A infraestrutura foi organizada através de módulos.
├── src
├── modules (recursos)
├── container
├── databases
├── functions
...
├── main.tf (executar módulos)
├── outputs.tf (conexões)
├── provider.tf (Azure)
...
Consulte o repositório do trabalho para mais detalhes do projeto.
- Terraform (Azure Provider)
- Azure CLI
az login
- (Opcional) Criar credenciais service principal para autenticação no Azure
az ad sp create-for-rbac --name "{NAME}" --role contributor --scopes /subscriptions/{SEU_AZURE_SUBSCRIPTION_ID}
Resultado da criação do service principal:
{
"clientId": "{AZURE_CLIENT_ID}",
"clientSecret": "{AZURE_CLIENT_SECRET}",
"subscriptionId": "{AZURE_SUBSCRIPTION_ID}",
"tenantId": "{AZURE_TENANT_ID}",
"activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
"resourceManagerEndpointUrl": "https://management.azure.com/",
"activeDirectoryGraphResourceId": "https://graph.windows.net/",
"sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
"galleryEndpointUrl": "https://gallery.azure.com/",
"managementEndpointUrl": "https://management.core.windows.net/"
}
Utilize variáveis clientId, clientSecret, subscriptionId e tenantId no provider:
provider "azurerm" {
version = ">= 2.0.0"
subscription_id = var.subscription_id
client_id = var.client_id
client_secret = var.client_secret
tenant_id = var.tenant_id
features {}
}
Neste projeto as variáveis estão no GitHub Secrets.
- Na pasta src na raíz do projeto executar os comandos Terraform desejados
terraform init (iniciar modulos e provider)
terraform validate (validar scripts)
terraform apply (aplicar infraestrutura)
terraform destroy (remover infraestrutura)
Mais comandos.