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
container { | |
name = "redis" | |
image = "docker.io/bitnami/redis:7.0" | |
cpu = "0.5" | |
memory = "1" | |
environment_variables = { | |
"ALLOW_EMPTY_PASSWORD" = "yes" | |
} |
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
container { | |
name = "elasticsearch" | |
image = "docker.io/bitnami/elasticsearch:8" | |
cpu = "1" | |
memory = "2" | |
environment_variables = { | |
"ELASTICSEARCH_ENABLE_SECURITY" = "true" | |
"ELASTICSEARCH_SKIP_TRANSPORT_TLS" = "true" | |
} |
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
container { | |
name = "postgresql" | |
image = "docker.io/bitnami/postgresql:15" | |
cpu = "0.5" | |
memory = "1" | |
environment_variables = { | |
"POSTGRESQL_DATABASE" = "bitnami_mastodon" | |
"POSTGRESQL_USERNAME" = local.database_user | |
} |
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
resource "azurerm_container_group" "this" { | |
name = "aci-${local.name}" | |
location = azurerm_resource_group.this.location | |
resource_group_name = azurerm_resource_group.this.name | |
ip_address_type = "Public" | |
dns_name_label = local.name | |
os_type = "Linux" | |
exposed_port { | |
port = "3000" |
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
locals { | |
name = "${var.deployment_name}-${var.location}" | |
database_user = "dbuser" | |
mastodon_user = "user" | |
mastodon_email = "user@email.com" | |
} | |
resource "azurerm_resource_group" "this" { | |
name = "rg-${local.name}" | |
location = var.location |
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
ledger_client = ConfidentialLedgerClient( | |
endpoint=ledger_url, | |
credential=credential, | |
ledger_certificate_path=ledger_tls_cert_file_name | |
) | |
sample_entry = {"contents": "Hello world!"} | |
ledger_client.create_ledger_entry(entry=sample_entry) | |
latest_entry = ledger_client.get_current_ledger_entry() |
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
identity_client = ConfidentialLedgerCertificateClient(identity_url) | |
network_identity = identity_client.get_ledger_identity( | |
ledger_id=ledger_name | |
) | |
ledger_tls_cert_file_name = "ledgercert.pem" | |
with open(ledger_tls_cert_file_name, "w") as cert_file: | |
cert_file.write(network_identity['ledgerTlsCertificate']) |
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
credential = DefaultAzureCredential() | |
confidential_ledger_mgmt = ConfidentialLedgerAPI( | |
credential, subscription_id | |
) | |
properties = { | |
"location": "eastus", | |
"tags": {}, | |
"properties": { | |
"ledgerType": "Public", |
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
from azure.identity import DefaultAzureCredential | |
from azure.mgmt.confidentialledger import ConfidentialLedger as ConfidentialLedgerAPI | |
from azure.mgmt.confidentialledger.models import ConfidentialLedger | |
from azure.confidentialledger import ConfidentialLedgerClient | |
from azure.confidentialledger.certificate import ConfidentialLedgerCertificateClient | |
resource_group = "rg-confidentialledger-eastus" | |
ledger_name = "acl-confidentialledger-eastus" | |
subscription_id = "<azure-subscription-id>" |
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
azure-identity | |
azure.mgmt.confidentialledger | |
azure.confidentialledger |