All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.ec2.inputs.GetInstanceArgs Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.60.0-alpha.1731982519
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.ec2.inputs;

import com.pulumi.aws.ec2.inputs.GetInstanceFilterArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class GetInstanceArgs extends com.pulumi.resources.InvokeArgs {

    public static final GetInstanceArgs Empty = new GetInstanceArgs();

    /**
     * One or more name/value pairs to use as filters. There are
     * several valid keys, for a full reference, check out
     * [describe-instances in the AWS CLI reference][1].
     * 
     */
    @Import(name="filters")
    private @Nullable Output> filters;

    /**
     * @return One or more name/value pairs to use as filters. There are
     * several valid keys, for a full reference, check out
     * [describe-instances in the AWS CLI reference][1].
     * 
     */
    public Optional>> filters() {
        return Optional.ofNullable(this.filters);
    }

    /**
     * If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
     * 
     */
    @Import(name="getPasswordData")
    private @Nullable Output getPasswordData;

    /**
     * @return If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
     * 
     */
    public Optional> getPasswordData() {
        return Optional.ofNullable(this.getPasswordData);
    }

    /**
     * Retrieve Base64 encoded User Data contents into the `user_data_base64` attribute. A SHA-1 hash of the User Data contents will always be present in the `user_data` attribute. Defaults to `false`.
     * 
     * > **NOTE:** At least one of `filter`, `instance_tags`, or `instance_id` must be specified.
     * 
     * > **NOTE:** If anything other than a single match is returned by the search,
     * this call will fail. Ensure that your search is specific enough to return
     * a single Instance ID only.
     * 
     */
    @Import(name="getUserData")
    private @Nullable Output getUserData;

    /**
     * @return Retrieve Base64 encoded User Data contents into the `user_data_base64` attribute. A SHA-1 hash of the User Data contents will always be present in the `user_data` attribute. Defaults to `false`.
     * 
     * > **NOTE:** At least one of `filter`, `instance_tags`, or `instance_id` must be specified.
     * 
     * > **NOTE:** If anything other than a single match is returned by the search,
     * this call will fail. Ensure that your search is specific enough to return
     * a single Instance ID only.
     * 
     */
    public Optional> getUserData() {
        return Optional.ofNullable(this.getUserData);
    }

    /**
     * Specify the exact Instance ID with which to populate the data source.
     * 
     */
    @Import(name="instanceId")
    private @Nullable Output instanceId;

    /**
     * @return Specify the exact Instance ID with which to populate the data source.
     * 
     */
    public Optional> instanceId() {
        return Optional.ofNullable(this.instanceId);
    }

    /**
     * Map of tags, each pair of which must
     * exactly match a pair on the desired Instance.
     * 
     */
    @Import(name="instanceTags")
    private @Nullable Output> instanceTags;

    /**
     * @return Map of tags, each pair of which must
     * exactly match a pair on the desired Instance.
     * 
     */
    public Optional>> instanceTags() {
        return Optional.ofNullable(this.instanceTags);
    }

    /**
     * Map of tags assigned to the Instance.
     * 
     */
    @Import(name="tags")
    private @Nullable Output> tags;

    /**
     * @return Map of tags assigned to the Instance.
     * 
     */
    public Optional>> tags() {
        return Optional.ofNullable(this.tags);
    }

    private GetInstanceArgs() {}

    private GetInstanceArgs(GetInstanceArgs $) {
        this.filters = $.filters;
        this.getPasswordData = $.getPasswordData;
        this.getUserData = $.getUserData;
        this.instanceId = $.instanceId;
        this.instanceTags = $.instanceTags;
        this.tags = $.tags;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(GetInstanceArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private GetInstanceArgs $;

        public Builder() {
            $ = new GetInstanceArgs();
        }

        public Builder(GetInstanceArgs defaults) {
            $ = new GetInstanceArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param filters One or more name/value pairs to use as filters. There are
         * several valid keys, for a full reference, check out
         * [describe-instances in the AWS CLI reference][1].
         * 
         * @return builder
         * 
         */
        public Builder filters(@Nullable Output> filters) {
            $.filters = filters;
            return this;
        }

        /**
         * @param filters One or more name/value pairs to use as filters. There are
         * several valid keys, for a full reference, check out
         * [describe-instances in the AWS CLI reference][1].
         * 
         * @return builder
         * 
         */
        public Builder filters(List filters) {
            return filters(Output.of(filters));
        }

        /**
         * @param filters One or more name/value pairs to use as filters. There are
         * several valid keys, for a full reference, check out
         * [describe-instances in the AWS CLI reference][1].
         * 
         * @return builder
         * 
         */
        public Builder filters(GetInstanceFilterArgs... filters) {
            return filters(List.of(filters));
        }

        /**
         * @param getPasswordData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
         * 
         * @return builder
         * 
         */
        public Builder getPasswordData(@Nullable Output getPasswordData) {
            $.getPasswordData = getPasswordData;
            return this;
        }

        /**
         * @param getPasswordData If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `password_data` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information.
         * 
         * @return builder
         * 
         */
        public Builder getPasswordData(Boolean getPasswordData) {
            return getPasswordData(Output.of(getPasswordData));
        }

        /**
         * @param getUserData Retrieve Base64 encoded User Data contents into the `user_data_base64` attribute. A SHA-1 hash of the User Data contents will always be present in the `user_data` attribute. Defaults to `false`.
         * 
         * > **NOTE:** At least one of `filter`, `instance_tags`, or `instance_id` must be specified.
         * 
         * > **NOTE:** If anything other than a single match is returned by the search,
         * this call will fail. Ensure that your search is specific enough to return
         * a single Instance ID only.
         * 
         * @return builder
         * 
         */
        public Builder getUserData(@Nullable Output getUserData) {
            $.getUserData = getUserData;
            return this;
        }

        /**
         * @param getUserData Retrieve Base64 encoded User Data contents into the `user_data_base64` attribute. A SHA-1 hash of the User Data contents will always be present in the `user_data` attribute. Defaults to `false`.
         * 
         * > **NOTE:** At least one of `filter`, `instance_tags`, or `instance_id` must be specified.
         * 
         * > **NOTE:** If anything other than a single match is returned by the search,
         * this call will fail. Ensure that your search is specific enough to return
         * a single Instance ID only.
         * 
         * @return builder
         * 
         */
        public Builder getUserData(Boolean getUserData) {
            return getUserData(Output.of(getUserData));
        }

        /**
         * @param instanceId Specify the exact Instance ID with which to populate the data source.
         * 
         * @return builder
         * 
         */
        public Builder instanceId(@Nullable Output instanceId) {
            $.instanceId = instanceId;
            return this;
        }

        /**
         * @param instanceId Specify the exact Instance ID with which to populate the data source.
         * 
         * @return builder
         * 
         */
        public Builder instanceId(String instanceId) {
            return instanceId(Output.of(instanceId));
        }

        /**
         * @param instanceTags Map of tags, each pair of which must
         * exactly match a pair on the desired Instance.
         * 
         * @return builder
         * 
         */
        public Builder instanceTags(@Nullable Output> instanceTags) {
            $.instanceTags = instanceTags;
            return this;
        }

        /**
         * @param instanceTags Map of tags, each pair of which must
         * exactly match a pair on the desired Instance.
         * 
         * @return builder
         * 
         */
        public Builder instanceTags(Map instanceTags) {
            return instanceTags(Output.of(instanceTags));
        }

        /**
         * @param tags Map of tags assigned to the Instance.
         * 
         * @return builder
         * 
         */
        public Builder tags(@Nullable Output> tags) {
            $.tags = tags;
            return this;
        }

        /**
         * @param tags Map of tags assigned to the Instance.
         * 
         * @return builder
         * 
         */
        public Builder tags(Map tags) {
            return tags(Output.of(tags));
        }

        public GetInstanceArgs build() {
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy