示例#1
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = [
    'endpoint',
    'poll_interval',
    'token',
]

__config__ = pulumi.Config('hcloud')

endpoint = __config__.get('endpoint')

poll_interval = __config__.get('pollInterval')

token = __config__.get('token')
"""
The API token to access the Hetzner cloud.
"""

示例#2
0
# re -> regular expression package
import re
import json
import boto3
import iam
import base64
import pulumi
import pulumi_aws as aws

config = pulumi.Config("mentionbot")
slack_token = config.get("slackToken")
verification_token = config.get("verificationToken")

#  Make a simple table that keeps track of which users have requested to be notified when their name
#  is mentioned, and which channel they'll be notified in.
subscriptions_table = aws.dynamodb.Table(
    'subscriptions',
    attributes=[aws.dynamodb.TableAttributeArgs(
        name="id",
        type="S",
    )],
    billing_mode="PAY_PER_REQUEST",
    hash_key="id")

# Slack has strict requirements on how fast you must be when responding to their messages. In order
# to ensure we don't respond too slowly, all we do is enqueue messages to this topic, and then
# return immediately.
# message_bus = aws.cloudwatch.EventBus('messages')
# message_bus =

##################
示例#3
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('fastly')

api_key = __config__.get('apiKey') or utilities.get_env('FASTLY_API_KEY')
"""
Fastly API Key from https://app.fastly.com/#account
"""

base_url = __config__.get('baseUrl') or (utilities.get_env('FASTLY_API_URL')
                                         or 'https://api.fastly.com')
"""
Fastly API URL
"""
示例#4
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

import types

__config__ = pulumi.Config('azure')


class _ExportableConfig(types.ModuleType):
    @property
    def auxiliary_tenant_ids(self) -> Optional[str]:
        return __config__.get('auxiliaryTenantIds')

    @property
    def client_certificate_password(self) -> Optional[str]:
        """
        The password associated with the Client Certificate. For use when authenticating as a Service Principal using a Client
        Certificate
        """
        return __config__.get('clientCertificatePassword')

    @property
    def client_certificate_path(self) -> Optional[str]:
示例#5
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

import types

__config__ = pulumi.Config('sakuracloud')


class _ExportableConfig(types.ModuleType):
    @property
    def accept_language(self) -> Optional[str]:
        """
        The value of AcceptLanguage header used when calling SakuraCloud API. It can also be sourced from the
        `SAKURACLOUD_ACCEPT_LANGUAGE` environment variables, or via a shared credentials file if `profile` is specified
        """
        return __config__.get('acceptLanguage')

    @property
    def api_request_rate_limit(self) -> Optional[int]:
        """
        The maximum number of SakuraCloud API calls per second. It can also be sourced from the `SAKURACLOUD_RATE_LIMIT`
        environment variables, or via a shared credentials file if `profile` is specified. Default:`10`
        """
        return __config__.get_int('apiRequestRateLimit')
示例#6
0
import random
import pulumi
import pulumi_aws as aws
import boto3

## Get config and set some globals
conf = pulumi.Config()
_APP = 'pulumi'
_REGION = boto3.session.Session().region_name
_OS = conf.require('Os')
_AMI = conf.require(f'AmiByOs.{_REGION}.{_OS}')
_PORT = conf.require_int(f'ConnectPortByOs.{_OS}')
_INST_TYPE = conf.require('InstanceType')
_AZ = conf.require('Az')
_STACK = pulumi.get_stack()

## Instatiate boto client and gather context
ec2 = boto3.client('ec2', region_name=_REGION)
vpc = ec2.describe_vpcs(Filters=[{
    'Name': 'tag:Name',
    'Values': [_STACK]
}])['Vpcs'][0]['VpcId']

subnets_response = ec2.describe_subnets(Filters=[{
    'Name': 'tag:Tier',
    'Values': ['public']
}, {
    'Name': 'vpc-id',
    'Values': [vpc]
}])
示例#7
0
import os
import time

import pulumi
from pulumi_gcp import cloudfunctions, storage, projects

project_name = os.getenv("project_name")
PATH_TO_SOURCE_CODE = "./functions"


def get_array_from_string(comma_separated_string):
    return comma_separated_string.split(",")


#you can set the confid by pulumi confif set mykey myvalue
config = pulumi.Config(name=None)
config_values = {"epic_secret_key": config.get("epic_secret_key")}

bucket = None

assets = {}

function_dictionary = {
    "hello_function": "handle_hello_function",
}

#traverse_dir_recur(PATH_TO_SOURCE_CODE,assets)
archive = pulumi.FileArchive(PATH_TO_SOURCE_CODE)


def enable_apis(services):
示例#8
0
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables

__all__ = [
    'app_id',
    'endpoint',
    'insecure',
    'password',
    'username',
]

__config__ = pulumi.Config('phpipam')

app_id = __config__.get('appId')
"""
The application ID required for API requests
"""

endpoint = __config__.get('endpoint')
"""
The full URL (plus path) to the API endpoint
"""

insecure = __config__.get('insecure')
"""
Whether server should be accessed without verifying the TLS certificate.
"""
示例#9
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

import types

__config__ = pulumi.Config('splunk')


class _ExportableConfig(types.ModuleType):
    @property
    def auth_token(self) -> Optional[str]:
        """
        Authentication tokens, also known as JSON Web Tokens (JWT), are a method for authenticating Splunk platform users into
        the Splunk platform
        """
        return __config__.get('authToken')

    @property
    def insecure_skip_verify(self) -> Optional[bool]:
        """
        insecure skip verification flag
        """
        return __config__.get_bool('insecureSkipVerify')
示例#10
0
文件: vars.py 项目: t0yv0/pulumi
# coding=utf-8
# *** WARNING: this file was generated by test. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from .. import outputs as _root_outputs

import types

__config__ = pulumi.Config('configstation')


class _ExportableConfig(types.ModuleType):
    @property
    def favorite_plants(self) -> Optional[str]:
        return __config__.get('favoritePlants')

    @property
    def favorite_sandwich(self) -> Optional[str]:
        """
        omg my favorite sandwich
        """
        return __config__.get('favoriteSandwich')

    @property
    def is_member(self) -> bool:
示例#11
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('dnsimple')

account = __config__.get('account') or (utilities.get_env('DNSIMPLE_ACCOUNT')
                                        or '')
"""
The account for API operations.
"""

email = __config__.get('email')
"""
The DNSimple account email address.
"""

token = __config__.get('token') or (utilities.get_env('DNSIMPLE_TOKEN') or '')
"""
The API v2 token for API operations.
"""
示例#12
0
"""A Google Cloud Python Pulumi program"""

import pulumi
from pulumi_google_native.storage import v1 as storage

config = pulumi.Config('google-native')
project = config.require('project')

# Create a Google Cloud resource (Storage Bucket)
bucket_name = "pulumi-goog-native-bucket-py-01"
bucket = storage.Bucket('my-bucket', name=bucket_name, bucket=bucket_name, project=project)

# Export the bucket self-link
pulumi.export('bucketSelfLink', bucket.self_link)

示例#13
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('datadog')

api_key = __config__.get('apiKey') or utilities.get_env('DATADOG_API_KEY')

api_url = __config__.get('apiUrl') or utilities.get_env('DATADOG_HOST')

app_key = __config__.get('appKey') or utilities.get_env('DATADOG_APP_KEY')

示例#14
0
import pulumi
from pulumi_azure import core, storage, containerservice, network
from pulumi_azuread import Application, ServicePrincipal, ServicePrincipalPassword
from pulumi_kubernetes import Provider, yaml

# read and set config values
config = pulumi.Config("kub-python")

SSHKEY = config.require("sshkey")

# create a Resource Group and Network for all resources
rg = core.ResourceGroup("rg-pul-aks")

# create vnet
vnet = network.VirtualNetwork("pul-aks-vnet",
                              name="pul-aks-vnet",
                              address_spaces=["10.1.0.0/16"],
                              resource_group_name=rg.name)

subnet = network.Subnet("aks-sn",
                        opts=pulumi.ResourceOptions(depends_on=[vnet]),
                        virtual_network_name=vnet.name,
                        address_prefix="10.1.0.0/24",
                        resource_group_name=rg.name)

aks = containerservice.KubernetesCluster(
    "aksCluster",
    opts=pulumi.ResourceOptions(depends_on=[subnet]),
    resource_group_name=rg.name,
    dns_prefix="pul",
    linux_profile={
示例#15
0
import pulumi
from pulumi import ResourceOptions
from pulumi_kubernetes import Provider
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service
from pulumi_azure.core import ResourceGroup
from pulumi_azure.containerservice import KubernetesCluster
from pulumi_azuread import Application, ServicePrincipal, ServicePrincipalPassword

# read and set config values
config = pulumi.Config("azure-py-aks")

PASSWORD = config.require_secret("password")
SSHKEY = config.require("sshkey")

# create a Resource Group and Network for all resources
resource_group = ResourceGroup("aks-rg")

# create Azure AD Application for AKS
app = Application("aks-app")

# create service principal for the application so AKS can act on behalf of the application
sp = ServicePrincipal(
    "aks-app-sp",
    application_id=app.application_id,
)

# create service principal password
sppwd = ServicePrincipalPassword(
    "aks-app-sp-pwd",
    service_principal_id=sp.id,
示例#16
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

import types

__config__ = pulumi.Config('docker')


class _ExportableConfig(types.ModuleType):
    @property
    def ca_material(self) -> Optional[str]:
        """
        PEM-encoded content of Docker host CA certificate
        """
        return __config__.get('caMaterial')

    @property
    def cert_material(self) -> Optional[str]:
        """
        PEM-encoded content of Docker client certificate
        """
        return __config__.get('certMaterial')
示例#17
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import pulumi
import pulumi.runtime

__config__ = pulumi.Config('aws')

access_key = __config__.get('accessKey')
"""
The access key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console.
"""

allowed_account_ids = __config__.get('allowedAccountIds')

assume_role = __config__.get('assumeRole')

dynamodb_endpoint = __config__.get('dynamodbEndpoint')
"""
Use this to override the default endpoint URL constructed from the `region`. It's typically used to connect to
dynamodb-local.
"""

endpoints = __config__.get('endpoints')

forbidden_account_ids = __config__.get('forbiddenAccountIds')

insecure = __config__.get('insecure')
"""
Explicitly allow the provider to perform "insecure" SSL requests. If omitted,default value is `false`
示例#18
0
import base64
import pulumi
from pulumi import ResourceOptions
from pulumi_azure_native import resources, containerservice, network, authorization
import pulumi_azuread as azuread
from pulumi_kubernetes import Provider

config = pulumi.Config("aks-hello-world")
prefix = config.require("prefix")
password = config.require("password")
ssh_public_key = config.require("sshkey")
location = config.get("location") or "east us"
subscription_id = authorization.get_client_config().subscription_id

# Create Azure AD Application for AKS
app = azuread.Application(f"{prefix}-aks-app",
                          display_name=f"{prefix}-aks-app")

# Create service principal for the application so AKS can act on behalf of the application
sp = azuread.ServicePrincipal("aks-sp", application_id=app.application_id)

# Create the service principal password
sppwd = azuread.ServicePrincipalPassword("aks-sp-pwd",
                                         service_principal_id=sp.id,
                                         end_date="2099-01-01T00:00:00Z")

rg = resources.ResourceGroup(f"{prefix}-rg", location=location)

vnet = network.VirtualNetwork(f"{prefix}-vnet",
                              location=rg.location,
                              resource_group_name=rg.name,
示例#19
0
import json

import pulumi
import pulumi_aws as aws
from pulumi import export, Output, ResourceOptions

import pulumi_redata as redata
from autotag import register_auto_tags

aws_config = pulumi.Config('aws')

aws_account_id = aws.get_caller_identity().account_id
aws_region = aws_config.require('region')

config = pulumi.Config()

# --- REQUIRED CONFIG ---

# Basic config - what VPC and subnets to deploy in?
private_subnet_ids = config.require_object('aws-private-subnet-ids')
public_subnet_ids = config.require_object('aws-public-subnet-ids')
redata_vpc = aws.ec2.get_vpc(id=config.require('aws-vpc-id'))

# External domain name + cert ARN for load balancer
target_domain = config.require('target-domain')
target_domain_cert = config.require('target-domain-cert')

# Service configuration

airflow_admin_email = config.require('airflow-admin-email')
airflow_admin_password = config.require_secret('airflow-admin-password')
示例#20
0
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables

__all__ = [
    'api_version',
    'auth_token',
    'url',
]

__config__ = pulumi.Config('rundeck')

api_version = __config__.get('apiVersion')
"""
API Version of the target Rundeck server.
"""

auth_token = __config__.get('authToken')
"""
Auth token to use with the Rundeck API.
"""

url = __config__.get('url')
"""
URL of the root of the target Rundeck server.
"""
示例#21
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('spotinst')

account = __config__.get('account') or (utilities.get_env('SPOTINST_ACCOUNT') or '')
"""
Spotinst Account ID
"""

token = __config__.get('token') or (utilities.get_env('SPOTINST_TOKEN') or '')
"""
Spotinst Personal API Access Token
"""

示例#22
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('digitalocean')

api_endpoint = __config__.get('apiEndpoint') or (utilities.get_env('DIGITALOCEAN_API_URL') or 'https://api.digitalocean.com')
"""
The URL to use for the DigitalOcean API.
"""

spaces_access_id = __config__.get('spacesAccessId') or utilities.get_env('SPACES_ACCESS_KEY_ID')
"""
The access key ID for Spaces API operations.
"""

spaces_secret_key = __config__.get('spacesSecretKey') or utilities.get_env('SPACES_SECRET_ACCESS_KEY')
"""
The secret access key for Spaces API operations.
"""

token = __config__.get('token') or utilities.get_env('DIGITALOCEAN_TOKEN')
"""
The token key for API operations.
示例#23
0
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables

__all__ = [
    'api_version',
    'max_retry_delay_ms',
    'min_retry_delay_ms',
    'skip_instance_ready_poll',
    'token',
    'ua_prefix',
    'url',
]

__config__ = pulumi.Config('linode')

api_version = __config__.get('apiVersion') or _utilities.get_env(
    'LINODE_API_VERSION')
"""
An HTTP User-Agent Prefix to prepend in API requests.
"""

max_retry_delay_ms = __config__.get('maxRetryDelayMs')
"""
Maximum delay in milliseconds before retrying a request.
"""

min_retry_delay_ms = __config__.get('minRetryDelayMs')
"""
Minimum delay in milliseconds before retrying a request.
示例#24
0
import pulumi
from pulumi import Config, export, ResourceOptions
from pulumi_azure import core, storage, network, lb, compute
import pulumi_random as random


config = pulumi.Config("ocp-pulumi")
root_certificates = config.get("root_certificates") 
public_certificate_data = config.get("public_certificate_data")
address_space = config.get("address_space")
vnet_address_spaces = config.get("vnet_address_spaces")
subnet_address_spaces = config.get("subnet_address_spaces")
vhd_name = config.get("vhd_name")
rhcos_storage_name = config.get("rhcos_storage_name")
gateway_address_spaces = config.get("gateway_address_spaces")
ssh_public_key = config.get("ssh_public_key")

config = pulumi.Config("repository")
admin_user = config.require("adminUser")
admin_password = config.require("adminPassword")

# Create an Azure Resource Group
resource_group = core.ResourceGroup('common-ocp', name='common-ocp')

# Create an Azure network 
vnet = network.VirtualNetwork(
    "company-vnet",
    name="company-vnet",
    resource_group_name=resource_group.name,
    address_spaces=[vnet_address_spaces])
示例#25
0
"""An Azure Python Pulumi program"""

import pulumi
from pulumi import ResourceOptions
from pulumi_azure import core, storage, mssql
from pulumi_azure.core import ResourceGroup
from pulumi_azure.storage import Account
from pulumi_azuread import Application, ServicePrincipal, ServicePrincipalPassword
from pulumi_azure.authorization import Assignment
from pulumi_azure.containerservice import KubernetesCluster, Registry
from pulumi_azure.network import VirtualNetwork, Subnet
from pulumi_kubernetes import Provider
from pulumi_kubernetes.apps.v1 import Deployment
from pulumi_kubernetes.core.v1 import Service, Namespace

config = pulumi.Config()
PASSWORD = config.require('password')
SSHKEY = config.require('sshPublicKey')
LOCATION = config.get('location') or 'east us'
SA_PASSWORD = config.require('sa_password')

app = Application('kzhou-app', name='kzhou-app')

sp = ServicePrincipal('kzhou-aks-sp', application_id=app.application_id)

sppwd = ServicePrincipalPassword('kzhou-aks-sp-pwd',
                                 service_principal_id=sp.id,
                                 end_date='2025-01-01T01:02:03Z',
                                 value=PASSWORD)

rg = ResourceGroup('rg', name='kzhou-rg', location=LOCATION)
示例#26
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('scaleway')

access_key = __config__.get('accessKey') or utilities.get_env('SCW_ACCESS_KEY')
"""
The Scaleway access key.
"""

organization = __config__.get('organization')

organization_id = __config__.get('organizationId') or utilities.get_env(
    'SCW_DEFAULT_ORGANIZATION_ID')
"""
The Scaleway organization ID.
"""

region = __config__.get('region') or utilities.get_env('SCW_DEFAULT_REGION')
"""
The Scaleway default region to use for your resources.
"""
示例#27
0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

__config__ = pulumi.Config('gcp')

access_context_manager_custom_endpoint = __config__.get(
    'accessContextManagerCustomEndpoint')

access_token = __config__.get('accessToken')

app_engine_custom_endpoint = __config__.get('appEngineCustomEndpoint')

artifact_registry_custom_endpoint = __config__.get(
    'artifactRegistryCustomEndpoint')

batching = __config__.get('batching')

big_query_custom_endpoint = __config__.get('bigQueryCustomEndpoint')

bigquery_connection_custom_endpoint = __config__.get(
    'bigqueryConnectionCustomEndpoint')

bigquery_data_transfer_custom_endpoint = __config__.get(
def get_key_file_location():
    """Returns google key file location"""
    config = pulumi.Config()
    return config.require("google_api_key_file")
示例#29
0
import pulumi_aws as aws
import pulumi

cfg = pulumi.Config()

bucket_name = cfg.require("s3-bucket-name")

required_tags = {
    'CreatedBy': 'Pulumi',
    'PulumiProject': pulumi.get_project(),
    'PulumiStack': pulumi.get_stack(),
}

bucket = aws.s3.Bucket(resource_name=bucket_name,
                       acl="private",
                       force_destroy=True,
                       tags=required_tags)

pulumi.export('bucket_name', bucket.id)
示例#30
0
def program():
    config = pulumi.Config()
    bad = config.get_int('bad') or 0
    if bad == 1:
        BadResource('bad_resource')