This file contains hidden or 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_role_assignment" "cosmosdb_reader" { | |
scope = azurerm_cosmosdb_account.cosmos.id | |
role_definition_name = "Cosmos DB Built-in Data Reader" | |
principal_id = azurerm_api_management.apim.identity[0].principal_id | |
} |
This file contains hidden or 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
import { SpanProcessor, Span, ReadableSpan } from '@opentelemetry/sdk-trace-base'; | |
class RemoveQueryParamsProcessor implements SpanProcessor { | |
onStart(span: Span): void { | |
// No action on span start for this processor | |
} | |
onEnd(span: ReadableSpan): void { | |
// Check if the span has an attribute that represents a URL | |
const url = span.attributes['http.url'] as string | undefined; |
This file contains hidden or 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
#!/bin/bash | |
# Directory dei moduli | |
MODULES_DIR=".terraform/modules" | |
HASHES_FILE="tfmodules.lock.json" | |
# Scaricare i moduli | |
terraform init | |
# Funzione per calcolare l'hash di un modulo |
This file contains hidden or 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
import appinsights from 'applicationinsights'; | |
import winston from 'winston'; | |
import { transports, format, Logger } from 'winston'; | |
// Configura Application Insights | |
appinsights.setup(process.env.APPINSIGHTS_INSTRUMENTATIONKEY) | |
.setAutoCollectConsole(false) | |
.start(); | |
const aiClient = appinsights.defaultClient; |
This file contains hidden or 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
Analytics Analytics/Analytics.puml | |
Athena Analytics/Athena.puml | |
AthenaDataSourceConnectors Analytics/AthenaDataSourceConnectors.puml | |
CleanRooms Analytics/CleanRooms.puml | |
CloudSearch Analytics/CloudSearch.puml | |
CloudSearchSearchDocuments Analytics/CloudSearchSearchDocuments.puml | |
DataExchange Analytics/DataExchange.puml | |
DataExchangeforAPIs Analytics/DataExchangeforAPIs.puml | |
DataPipeline Analytics/DataPipeline.puml | |
DataZone Analytics/DataZone.puml |
This file contains hidden or 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
terraform { | |
required_version = ">= 1.0.0" | |
backend "s3" {} | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "= 4.63.0" | |
configuration_aliases = [aws.alternate] |
This file contains hidden or 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
# Create the whole infrastructure to run the Strapi CMS webserver | |
# and the static frontend that uses nextjs. | |
# Terraform provider configuration | |
variable "db_name" { | |
description = "The name of the database" | |
default = "my_database" | |
} |
This file contains hidden or 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
import { identity, pipe } from "fp-ts/lib/function"; | |
import * as E from "fp-ts/lib/Either"; | |
import * as t from "io-ts"; | |
import { WithinRangeInteger } from "./numbers"; | |
const _isNonEmptyUint8Array = (u: unknown): u is Uint8Array => | |
Array.isArray(u) && u.length > 0 && t.array(WithinRangeInteger(0, 256)).is(u); | |
export const NonEmptyUint8Array = new t.Type<Uint8Array, Uint8Array, unknown>( | |
"NonEmptyUint8Array", |
This file contains hidden or 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
import { pipe } from "fp-ts/lib/function"; | |
import * as E from "fp-ts/lib/Either"; | |
import * as t from "io-ts"; | |
import { WithinRangeInteger } from "./numbers"; | |
export const NonEmptyUint8Array = new t.Type<Uint8Array, String, Array<number>>( | |
"NonEmptyUint8Array", | |
(u): u is Uint8Array => | |
t.array(WithinRangeInteger(0, 256)).is(u) && u.length > 0, | |
(u, c) => |
This file contains hidden or 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
import { isRight } from "fp-ts/lib/Either"; | |
import { MobileNumberFromString, PatternString } from "../strings"; | |
describe("MobileNumberFromString", () => { | |
it("should fail", () => { | |
const ps = MobileNumberFromString.decode("ABCD"); | |
expect(isRight(ps)).toBeFalsy(); | |
}); | |
it("should success", () => { | |
const ps = MobileNumberFromString.decode("123456789"); |
NewerOlder