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

com.pulumi.aws.cloudfront.inputs.DistributionOriginArgs Maven / Gradle / Ivy

// *** 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.cloudfront.inputs;

import com.pulumi.aws.cloudfront.inputs.DistributionOriginCustomHeaderArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginCustomOriginConfigArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginOriginShieldArgs;
import com.pulumi.aws.cloudfront.inputs.DistributionOriginS3OriginConfigArgs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class DistributionOriginArgs extends com.pulumi.resources.ResourceArgs {

    public static final DistributionOriginArgs Empty = new DistributionOriginArgs();

    /**
     * Number of times that CloudFront attempts to connect to the origin. Must be between 1-3. Defaults to 3.
     * 
     */
    @Import(name="connectionAttempts")
    private @Nullable Output connectionAttempts;

    /**
     * @return Number of times that CloudFront attempts to connect to the origin. Must be between 1-3. Defaults to 3.
     * 
     */
    public Optional> connectionAttempts() {
        return Optional.ofNullable(this.connectionAttempts);
    }

    /**
     * Number of seconds that CloudFront waits when trying to establish a connection to the origin. Must be between 1-10. Defaults to 10.
     * 
     */
    @Import(name="connectionTimeout")
    private @Nullable Output connectionTimeout;

    /**
     * @return Number of seconds that CloudFront waits when trying to establish a connection to the origin. Must be between 1-10. Defaults to 10.
     * 
     */
    public Optional> connectionTimeout() {
        return Optional.ofNullable(this.connectionTimeout);
    }

    /**
     * One or more sub-resources with `name` and `value` parameters that specify header data that will be sent to the origin (multiples allowed).
     * 
     */
    @Import(name="customHeaders")
    private @Nullable Output> customHeaders;

    /**
     * @return One or more sub-resources with `name` and `value` parameters that specify header data that will be sent to the origin (multiples allowed).
     * 
     */
    public Optional>> customHeaders() {
        return Optional.ofNullable(this.customHeaders);
    }

    /**
     * The CloudFront custom origin configuration information. If an S3 origin is required, use `origin_access_control_id` or `s3_origin_config` instead.
     * 
     */
    @Import(name="customOriginConfig")
    private @Nullable Output customOriginConfig;

    /**
     * @return The CloudFront custom origin configuration information. If an S3 origin is required, use `origin_access_control_id` or `s3_origin_config` instead.
     * 
     */
    public Optional> customOriginConfig() {
        return Optional.ofNullable(this.customOriginConfig);
    }

    /**
     * Domain name corresponding to the distribution. For example: `d604721fxaaqy9.cloudfront.net`.
     * 
     */
    @Import(name="domainName", required=true)
    private Output domainName;

    /**
     * @return Domain name corresponding to the distribution. For example: `d604721fxaaqy9.cloudfront.net`.
     * 
     */
    public Output domainName() {
        return this.domainName;
    }

    /**
     * Unique identifier of a [CloudFront origin access control][8] for this origin.
     * 
     */
    @Import(name="originAccessControlId")
    private @Nullable Output originAccessControlId;

    /**
     * @return Unique identifier of a [CloudFront origin access control][8] for this origin.
     * 
     */
    public Optional> originAccessControlId() {
        return Optional.ofNullable(this.originAccessControlId);
    }

    @Import(name="originId", required=true)
    private Output originId;

    public Output originId() {
        return this.originId;
    }

    /**
     * Optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
     * 
     */
    @Import(name="originPath")
    private @Nullable Output originPath;

    /**
     * @return Optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
     * 
     */
    public Optional> originPath() {
        return Optional.ofNullable(this.originPath);
    }

    /**
     * CloudFront Origin Shield configuration information. Using Origin Shield can help reduce the load on your origin. For more information, see [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the Amazon CloudFront Developer Guide.
     * 
     */
    @Import(name="originShield")
    private @Nullable Output originShield;

    /**
     * @return CloudFront Origin Shield configuration information. Using Origin Shield can help reduce the load on your origin. For more information, see [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the Amazon CloudFront Developer Guide.
     * 
     */
    public Optional> originShield() {
        return Optional.ofNullable(this.originShield);
    }

    /**
     * CloudFront S3 origin configuration information. If a custom origin is required, use `custom_origin_config` instead.
     * 
     */
    @Import(name="s3OriginConfig")
    private @Nullable Output s3OriginConfig;

    /**
     * @return CloudFront S3 origin configuration information. If a custom origin is required, use `custom_origin_config` instead.
     * 
     */
    public Optional> s3OriginConfig() {
        return Optional.ofNullable(this.s3OriginConfig);
    }

    private DistributionOriginArgs() {}

    private DistributionOriginArgs(DistributionOriginArgs $) {
        this.connectionAttempts = $.connectionAttempts;
        this.connectionTimeout = $.connectionTimeout;
        this.customHeaders = $.customHeaders;
        this.customOriginConfig = $.customOriginConfig;
        this.domainName = $.domainName;
        this.originAccessControlId = $.originAccessControlId;
        this.originId = $.originId;
        this.originPath = $.originPath;
        this.originShield = $.originShield;
        this.s3OriginConfig = $.s3OriginConfig;
    }

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

    public static final class Builder {
        private DistributionOriginArgs $;

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

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

        /**
         * @param connectionAttempts Number of times that CloudFront attempts to connect to the origin. Must be between 1-3. Defaults to 3.
         * 
         * @return builder
         * 
         */
        public Builder connectionAttempts(@Nullable Output connectionAttempts) {
            $.connectionAttempts = connectionAttempts;
            return this;
        }

        /**
         * @param connectionAttempts Number of times that CloudFront attempts to connect to the origin. Must be between 1-3. Defaults to 3.
         * 
         * @return builder
         * 
         */
        public Builder connectionAttempts(Integer connectionAttempts) {
            return connectionAttempts(Output.of(connectionAttempts));
        }

        /**
         * @param connectionTimeout Number of seconds that CloudFront waits when trying to establish a connection to the origin. Must be between 1-10. Defaults to 10.
         * 
         * @return builder
         * 
         */
        public Builder connectionTimeout(@Nullable Output connectionTimeout) {
            $.connectionTimeout = connectionTimeout;
            return this;
        }

        /**
         * @param connectionTimeout Number of seconds that CloudFront waits when trying to establish a connection to the origin. Must be between 1-10. Defaults to 10.
         * 
         * @return builder
         * 
         */
        public Builder connectionTimeout(Integer connectionTimeout) {
            return connectionTimeout(Output.of(connectionTimeout));
        }

        /**
         * @param customHeaders One or more sub-resources with `name` and `value` parameters that specify header data that will be sent to the origin (multiples allowed).
         * 
         * @return builder
         * 
         */
        public Builder customHeaders(@Nullable Output> customHeaders) {
            $.customHeaders = customHeaders;
            return this;
        }

        /**
         * @param customHeaders One or more sub-resources with `name` and `value` parameters that specify header data that will be sent to the origin (multiples allowed).
         * 
         * @return builder
         * 
         */
        public Builder customHeaders(List customHeaders) {
            return customHeaders(Output.of(customHeaders));
        }

        /**
         * @param customHeaders One or more sub-resources with `name` and `value` parameters that specify header data that will be sent to the origin (multiples allowed).
         * 
         * @return builder
         * 
         */
        public Builder customHeaders(DistributionOriginCustomHeaderArgs... customHeaders) {
            return customHeaders(List.of(customHeaders));
        }

        /**
         * @param customOriginConfig The CloudFront custom origin configuration information. If an S3 origin is required, use `origin_access_control_id` or `s3_origin_config` instead.
         * 
         * @return builder
         * 
         */
        public Builder customOriginConfig(@Nullable Output customOriginConfig) {
            $.customOriginConfig = customOriginConfig;
            return this;
        }

        /**
         * @param customOriginConfig The CloudFront custom origin configuration information. If an S3 origin is required, use `origin_access_control_id` or `s3_origin_config` instead.
         * 
         * @return builder
         * 
         */
        public Builder customOriginConfig(DistributionOriginCustomOriginConfigArgs customOriginConfig) {
            return customOriginConfig(Output.of(customOriginConfig));
        }

        /**
         * @param domainName Domain name corresponding to the distribution. For example: `d604721fxaaqy9.cloudfront.net`.
         * 
         * @return builder
         * 
         */
        public Builder domainName(Output domainName) {
            $.domainName = domainName;
            return this;
        }

        /**
         * @param domainName Domain name corresponding to the distribution. For example: `d604721fxaaqy9.cloudfront.net`.
         * 
         * @return builder
         * 
         */
        public Builder domainName(String domainName) {
            return domainName(Output.of(domainName));
        }

        /**
         * @param originAccessControlId Unique identifier of a [CloudFront origin access control][8] for this origin.
         * 
         * @return builder
         * 
         */
        public Builder originAccessControlId(@Nullable Output originAccessControlId) {
            $.originAccessControlId = originAccessControlId;
            return this;
        }

        /**
         * @param originAccessControlId Unique identifier of a [CloudFront origin access control][8] for this origin.
         * 
         * @return builder
         * 
         */
        public Builder originAccessControlId(String originAccessControlId) {
            return originAccessControlId(Output.of(originAccessControlId));
        }

        public Builder originId(Output originId) {
            $.originId = originId;
            return this;
        }

        public Builder originId(String originId) {
            return originId(Output.of(originId));
        }

        /**
         * @param originPath Optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
         * 
         * @return builder
         * 
         */
        public Builder originPath(@Nullable Output originPath) {
            $.originPath = originPath;
            return this;
        }

        /**
         * @param originPath Optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
         * 
         * @return builder
         * 
         */
        public Builder originPath(String originPath) {
            return originPath(Output.of(originPath));
        }

        /**
         * @param originShield CloudFront Origin Shield configuration information. Using Origin Shield can help reduce the load on your origin. For more information, see [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the Amazon CloudFront Developer Guide.
         * 
         * @return builder
         * 
         */
        public Builder originShield(@Nullable Output originShield) {
            $.originShield = originShield;
            return this;
        }

        /**
         * @param originShield CloudFront Origin Shield configuration information. Using Origin Shield can help reduce the load on your origin. For more information, see [Using Origin Shield](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/origin-shield.html) in the Amazon CloudFront Developer Guide.
         * 
         * @return builder
         * 
         */
        public Builder originShield(DistributionOriginOriginShieldArgs originShield) {
            return originShield(Output.of(originShield));
        }

        /**
         * @param s3OriginConfig CloudFront S3 origin configuration information. If a custom origin is required, use `custom_origin_config` instead.
         * 
         * @return builder
         * 
         */
        public Builder s3OriginConfig(@Nullable Output s3OriginConfig) {
            $.s3OriginConfig = s3OriginConfig;
            return this;
        }

        /**
         * @param s3OriginConfig CloudFront S3 origin configuration information. If a custom origin is required, use `custom_origin_config` instead.
         * 
         * @return builder
         * 
         */
        public Builder s3OriginConfig(DistributionOriginS3OriginConfigArgs s3OriginConfig) {
            return s3OriginConfig(Output.of(s3OriginConfig));
        }

        public DistributionOriginArgs build() {
            if ($.domainName == null) {
                throw new MissingRequiredPropertyException("DistributionOriginArgs", "domainName");
            }
            if ($.originId == null) {
                throw new MissingRequiredPropertyException("DistributionOriginArgs", "originId");
            }
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy