How to use the pulumi.Output.from_input function in pulumi

To help you get started, we’ve selected a few pulumi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / pulumi-aws / sdk / python / pulumi_aws / provider.py View on Github external
token: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ProviderArgs.__new__(ProviderArgs)

            __props__.__dict__["access_key"] = access_key
            __props__.__dict__["allowed_account_ids"] = pulumi.Output.from_input(allowed_account_ids).apply(pulumi.runtime.to_json) if allowed_account_ids is not None else None
            __props__.__dict__["assume_role"] = pulumi.Output.from_input(assume_role).apply(pulumi.runtime.to_json) if assume_role is not None else None
            __props__.__dict__["default_tags"] = pulumi.Output.from_input(default_tags).apply(pulumi.runtime.to_json) if default_tags is not None else None
            __props__.__dict__["endpoints"] = pulumi.Output.from_input(endpoints).apply(pulumi.runtime.to_json) if endpoints is not None else None
            __props__.__dict__["forbidden_account_ids"] = pulumi.Output.from_input(forbidden_account_ids).apply(pulumi.runtime.to_json) if forbidden_account_ids is not None else None
            __props__.__dict__["ignore_tags"] = pulumi.Output.from_input(ignore_tags).apply(pulumi.runtime.to_json) if ignore_tags is not None else None
            __props__.__dict__["insecure"] = pulumi.Output.from_input(insecure).apply(pulumi.runtime.to_json) if insecure is not None else None
            __props__.__dict__["max_retries"] = pulumi.Output.from_input(max_retries).apply(pulumi.runtime.to_json) if max_retries is not None else None
            if profile is None:
                profile = _utilities.get_env('AWS_PROFILE')
            __props__.__dict__["profile"] = profile
            if region is None:
                region = _utilities.get_env('AWS_REGION', 'AWS_DEFAULT_REGION')
            __props__.__dict__["region"] = region
            __props__.__dict__["s3_force_path_style"] = pulumi.Output.from_input(s3_force_path_style).apply(pulumi.runtime.to_json) if s3_force_path_style is not None else None
            __props__.__dict__["secret_key"] = secret_key
            __props__.__dict__["shared_credentials_file"] = shared_credentials_file
            if skip_credentials_validation is None:
github pulumi / pulumi-kubernetes / provider / pkg / gen / python-templates / helm / v2 / helm.py View on Github external
def get_resource(self,
                     group_version_kind: str,
                     name: str,
                     namespace: Optional[str] = None) -> pulumi.Output[pulumi.CustomResource]:
        """
        get_resource returns a resource defined by a built-in Kubernetes group/version/kind and
        name. For example: `get_resource("apps/v1/Deployment", "nginx")`

        :param str group_version_kind: Group/Version/Kind of the resource, e.g., `apps/v1/Deployment`
        :param str name: Name of the resource to retrieve
        :param Optional[str] namespace: Optional namespace of the resource to retrieve
        """

        # `id` will either be `${name}` or `${namespace}/${name}`.
        id = pulumi.Output.from_input(name)
        if namespace is not None:
            id = pulumi.Output.concat(namespace, '/', name)

        resource_id = id.apply(lambda x: f'{group_version_kind}:{x}')
        return resource_id.apply(lambda x: self.resources[x])
github pulumi / pulumi-aws / sdk / python / pulumi_aws / provider.py View on Github external
__props__.__dict__["s3_force_path_style"] = pulumi.Output.from_input(s3_force_path_style).apply(pulumi.runtime.to_json) if s3_force_path_style is not None else None
            __props__.__dict__["secret_key"] = secret_key
            __props__.__dict__["shared_credentials_file"] = shared_credentials_file
            if skip_credentials_validation is None:
                skip_credentials_validation = True
            __props__.__dict__["skip_credentials_validation"] = pulumi.Output.from_input(skip_credentials_validation).apply(pulumi.runtime.to_json) if skip_credentials_validation is not None else None
            if skip_get_ec2_platforms is None:
                skip_get_ec2_platforms = True
            __props__.__dict__["skip_get_ec2_platforms"] = pulumi.Output.from_input(skip_get_ec2_platforms).apply(pulumi.runtime.to_json) if skip_get_ec2_platforms is not None else None
            if skip_metadata_api_check is None:
                skip_metadata_api_check = True
            __props__.__dict__["skip_metadata_api_check"] = pulumi.Output.from_input(skip_metadata_api_check).apply(pulumi.runtime.to_json) if skip_metadata_api_check is not None else None
            if skip_region_validation is None:
                skip_region_validation = True
            __props__.__dict__["skip_region_validation"] = pulumi.Output.from_input(skip_region_validation).apply(pulumi.runtime.to_json) if skip_region_validation is not None else None
            __props__.__dict__["skip_requesting_account_id"] = pulumi.Output.from_input(skip_requesting_account_id).apply(pulumi.runtime.to_json) if skip_requesting_account_id is not None else None
            __props__.__dict__["token"] = token
        super(Provider, __self__).__init__(
            'aws',
            resource_name,
            __props__,
            opts)
github pulumi / pulumi-kubernetes / sdk / python / pulumi_kubernetes / helm / v3 / helm.py View on Github external
def to_json(self):
        return pulumi.Output.from_input(self.__dict__).apply(
            lambda x: json.dumps(x, default=lambda o: {k: v for (k, v) in o.__dict__.items() if v is not None}))
github pulumi / pulumi-aws / sdk / python / pulumi_aws / provider.py View on Github external
if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ProviderArgs.__new__(ProviderArgs)

            __props__.__dict__["access_key"] = access_key
            __props__.__dict__["allowed_account_ids"] = pulumi.Output.from_input(allowed_account_ids).apply(pulumi.runtime.to_json) if allowed_account_ids is not None else None
            __props__.__dict__["assume_role"] = pulumi.Output.from_input(assume_role).apply(pulumi.runtime.to_json) if assume_role is not None else None
            __props__.__dict__["default_tags"] = pulumi.Output.from_input(default_tags).apply(pulumi.runtime.to_json) if default_tags is not None else None
            __props__.__dict__["endpoints"] = pulumi.Output.from_input(endpoints).apply(pulumi.runtime.to_json) if endpoints is not None else None
            __props__.__dict__["forbidden_account_ids"] = pulumi.Output.from_input(forbidden_account_ids).apply(pulumi.runtime.to_json) if forbidden_account_ids is not None else None
            __props__.__dict__["ignore_tags"] = pulumi.Output.from_input(ignore_tags).apply(pulumi.runtime.to_json) if ignore_tags is not None else None
            __props__.__dict__["insecure"] = pulumi.Output.from_input(insecure).apply(pulumi.runtime.to_json) if insecure is not None else None
            __props__.__dict__["max_retries"] = pulumi.Output.from_input(max_retries).apply(pulumi.runtime.to_json) if max_retries is not None else None
            if profile is None:
                profile = _utilities.get_env('AWS_PROFILE')
            __props__.__dict__["profile"] = profile
            if region is None:
                region = _utilities.get_env('AWS_REGION', 'AWS_DEFAULT_REGION')
            __props__.__dict__["region"] = region
            __props__.__dict__["s3_force_path_style"] = pulumi.Output.from_input(s3_force_path_style).apply(pulumi.runtime.to_json) if s3_force_path_style is not None else None
            __props__.__dict__["secret_key"] = secret_key
            __props__.__dict__["shared_credentials_file"] = shared_credentials_file
            if skip_credentials_validation is None:
                skip_credentials_validation = True
            __props__.__dict__["skip_credentials_validation"] = pulumi.Output.from_input(skip_credentials_validation).apply(pulumi.runtime.to_json) if skip_credentials_validation is not None else None
github pulumi / pulumi-aws / sdk / python / pulumi_aws / provider.py View on Github external
__props__.__dict__["max_retries"] = pulumi.Output.from_input(max_retries).apply(pulumi.runtime.to_json) if max_retries is not None else None
            if profile is None:
                profile = _utilities.get_env('AWS_PROFILE')
            __props__.__dict__["profile"] = profile
            if region is None:
                region = _utilities.get_env('AWS_REGION', 'AWS_DEFAULT_REGION')
            __props__.__dict__["region"] = region
            __props__.__dict__["s3_force_path_style"] = pulumi.Output.from_input(s3_force_path_style).apply(pulumi.runtime.to_json) if s3_force_path_style is not None else None
            __props__.__dict__["secret_key"] = secret_key
            __props__.__dict__["shared_credentials_file"] = shared_credentials_file
            if skip_credentials_validation is None:
                skip_credentials_validation = True
            __props__.__dict__["skip_credentials_validation"] = pulumi.Output.from_input(skip_credentials_validation).apply(pulumi.runtime.to_json) if skip_credentials_validation is not None else None
            if skip_get_ec2_platforms is None:
                skip_get_ec2_platforms = True
            __props__.__dict__["skip_get_ec2_platforms"] = pulumi.Output.from_input(skip_get_ec2_platforms).apply(pulumi.runtime.to_json) if skip_get_ec2_platforms is not None else None
            if skip_metadata_api_check is None:
                skip_metadata_api_check = True
            __props__.__dict__["skip_metadata_api_check"] = pulumi.Output.from_input(skip_metadata_api_check).apply(pulumi.runtime.to_json) if skip_metadata_api_check is not None else None
            if skip_region_validation is None:
                skip_region_validation = True
            __props__.__dict__["skip_region_validation"] = pulumi.Output.from_input(skip_region_validation).apply(pulumi.runtime.to_json) if skip_region_validation is not None else None
            __props__.__dict__["skip_requesting_account_id"] = pulumi.Output.from_input(skip_requesting_account_id).apply(pulumi.runtime.to_json) if skip_requesting_account_id is not None else None
            __props__.__dict__["token"] = token
        super(Provider, __self__).__init__(
            'aws',
            resource_name,
            __props__,
            opts)
github pulumi / pulumi-kubernetes / sdk / python / pulumi_kubernetes / yaml.py View on Github external
if not files:
            files = []
        if not yaml:
            yaml = []

        __props__ = dict()

        if resource_prefix:
            name = f"{resource_prefix}-{name}"
        super(ConfigGroup, self).__init__(
            "kubernetes:yaml:ConfigGroup",
            name,
            __props__,
            opts)

        self.resources = pulumi.Output.from_input({})

        _files: List[str] = []
        for file in files:
            if _is_url(file):
                _files.append(file)
            else:
                _files += [f for f in glob(file)]

        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(parent=self))

        for file in _files:
            cf = ConfigFile(
                file, file_id=file, transformations=transformations, resource_prefix=resource_prefix, opts=opts)
            # Add any new ConfigFile resources to the ConfigGroup's resources
            self.resources = pulumi.Output.all(cf.resources, self.resources).apply(lambda x: {**x[0], **x[1]})
github pulumi / pulumi-terraform / sdk / python / pulumi_terraform / state / remote_state_reference.py View on Github external
def get_output(self, name: pulumi.Input[str]):
        """
        Fetches the value of a root output from the Terraform Remote State.

        :param name: The name of the output to fetch. The name is formatted exactly as per the "output" block in the
        Terraform configuration.
        :return: A pulumi.Output representing the value.
        """
        return pulumi.Output.all(pulumi.Output.from_input(name), self.outputs).apply(lambda args: args[1][args[0]])
github SwissDataScienceCenter / renku / renku_pulumi / resources / main / secrets.py View on Github external
upper=True)

    return Secret(
        'renku-jupyterhub-postgres',
        metadata={
            'name': 'renku-jupyterhub-postgres',
            'labels':
                {
                    "app": pulumi.get_project(),
                    "release": pulumi.get_stack()
                }
        },
        type='Opaque',
        data={
            'jupyterhub-postgres-password':
                Output.from_input(jupyterhub_db_password).result.apply(
                    lambda p: b64encode(p))
        },
        opts=pulumi.ResourceOptions(delete_before_replace=True)
    )