Package: pulumi-automation-utils
pulumi-automation-utilsCollection of utilities useful for deployingpulumiInfrastructure as Code. These utilities aid in configuration and creation of
resource dependencies needed by pulumi.FilesBelow is a list of all of the files and an inclination for how each can be
used within your project.certs_and_keys.pyThis file contains two functions. These arecreate_key_pairandcreate_signed_certificate. Thecreate_key_pairfunction allows for the
creation of an RSA 4096 bit public/private key pair. Thecreate_signed_certificatefunction allows the user to create a signed
certificate using an existing CA key pair. It is possible to create the CA
key pair using thecreate_key_pairand use it as the basis for creating
a self-signed certificate.common.pyThis file contains any and all generic function definitions that are
utilized when setting up the development environment to support pulumi
deployments. These functions include:parse_yaml_file- read from a YAML filesending commands to the OSretrieving information from Azureenvironment.pyThis file contains an Enum class representing each of the possible
environment types.login_config.pyThis file contains two classes. The first is theLoginModeclass that is an
Enum used to represent the options one could use for logging into Azure. The
second is a class by the nameLoginConfig; this class is responsible for
maintaining all configuration associated with the deployment user including
login status, and providing a function for allowing the user to login. TheLoginConfigclass takes in a single variable, theyaml_varsretrieved
from the result of theparse_yaml_filefunction incommon.py.The following keys can be at the root of the YAML file to be consumed byLoginConfig:subscription(optional) The ID of the subscription in which to deploy infrastructureapp_id(optional) The Application Client ID for the service principal to login to
Azureclient_secret(optional) The Service Principal Client Secret to login to AzureRecommend keeping the YAML configuration file safe if any sensitive
information is stored withinlogin_mode(optional) The mode for logging into Azure. Currently supported options
are: "interactive", "service_principal", or "managed_identity".tenand_id(optional) The Tenant ID for the Service Principal to login to AzureUse theis_logged_infunction to test whether the user is currently logged
in. Thelogin_to_azurefunction is used to login to Azure via the login_mode
specified. Interactive is the default login mode if one is not supplied. In
interactive login, a URL and device code are supplied where the user can
login from another machine to provide authorization.pulumi_config.pyThis file is used for managing pulumi in a semi-automated fashion. ThePulumiConfigclass takes in theLoginConfigand theyaml_varsoutput via
theparse_yaml_filefunction incommon.py. ThePulumiConfigobject sorts
through the YAML to get all of the configuration parameters necessary to deploy
infrastructure via pulumi.This class expects the following resources to be defined within the YAML configuration:storage_accountHouses storage container used for backend state managementstorage_containerHouses the blobs that manage backend statekey_vaultManages encryption key used for securing pulumi sensitive informationThese resources are required to be configured and available at the time the
user issues thepulumi loginandpulumi stack selectcommands.YAML ConfigurationThe YAML configuration is used as the basis for deploying the resources
necessary to support deploying any pulumi project or stack in your Azure
subscription. This YAML configuration has some rules to smoothly configure
resources accordingly. The following lays out the structure of the overall
YAML configuration file.environment(required) The name of the environment (one of sandbox, zonec, zoneb,
zonea, or prod)project_name(required) The name of the project to deploy. Must match the name inPulumi.ymlstack_name(required) The name of the stack to deploy. Anything you wantproject_location(required) The path to the directory of the pulumi project.If this is not a full path, therepo_rootmust be passed to thePulumiConfigclass at creation timestorage_account(required) The configuration object that specifies information about the
storage account used with pulumiresource_group(optional) The name of the resource group that the Azure Key Vault
resides instorage_container(required) The configuration block of the Storage Account Blob Container
that is used with puluminame(required) The name of the Storage Account Blob Containersas_token(optional) The configuration block of the SAS token to be created/used
with pulumi to access Storage Account Blob Containername(required) If this block is declared, the name of the SAS token must be
declaredkey_vault(required) The configuration object that specifies information about the
Azure Key Vault used with pulumiresource_group(optional) The name of the resource group that the Azure Key Vault
resides inpulumi(required) Configuration block that contains a dictionary of all the
configuration parameters required by your pulumi scriptsIf no resource_group_name is specified, the first resource group returned
in the list from the subscription will be used for resource_group_name and
resource_group_id config itemsIf no storage_account_name is specified, the storage account from the
config above will be used for the storage_account_name and storage_account_id
config itemsIf no key_vault_name is specified, the key vault name and ID from the
config above will be used for the key_vault_name and key_vault_id config
itemspulumi-secrets(optional) Configuration block that contains key/value pairs of all the
secret configuration parameters required by your pulumi scripts