// *** WARNING: this file was generated by Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AwsxGo.Ecr
{
    /// <summary>
    /// Builds a docker image and pushes to the ECR repository
    /// </summary>
    [AwsxGoResourceType("awsx-go:ecr:Image")]
    public partial class Image : Pulumi.ComponentResource
    {
        /// <summary>
        /// Unique identifier of the pushed image
        /// </summary>
        [Output("imageUri")]
        public Output<string> ImageUri { get; private set; } = null!;


        /// <summary>
        /// Create a Image resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Image(string name, ImageArgs args, ComponentResourceOptions? options = null)
            : base("awsx-go:ecr:Image", name, args ?? new ImageArgs(), MakeResourceOptions(options, ""), remote: true)
        {
        }

        private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new ComponentResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = ComponentResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
    }

    public sealed class ImageArgs : Pulumi.ResourceArgs
    {
        [Input("args")]
        private InputMap<string>? _args;

        /// <summary>
        /// An optional map of named build-time argument variables to set during the Docker build.  This flag allows you to pass built-time variables that can be accessed like environment variables inside the `RUN` instruction.
        /// </summary>
        public InputMap<string> Args
        {
            get => _args ?? (_args = new InputMap<string>());
            set => _args = value;
        }

        [Input("cacheFrom")]
        private InputList<string>? _cacheFrom;

        /// <summary>
        /// Images to consider as cache sources
        /// </summary>
        public InputList<string> CacheFrom
        {
            get => _cacheFrom ?? (_cacheFrom = new InputList<string>());
            set => _cacheFrom = value;
        }

        /// <summary>
        /// dockerfile may be used to override the default Dockerfile name and/or location.  By default, it is assumed to be a file named Dockerfile in the root of the build context.
        /// </summary>
        [Input("dockerfile")]
        public Input<string>? Dockerfile { get; set; }

        [Input("env")]
        private InputMap<string>? _env;

        /// <summary>
        /// Environment variables to set on the invocation of `docker build`, for example to support `DOCKER_BUILDKIT=1 docker build`.
        /// </summary>
        public InputMap<string> Env
        {
            get => _env ?? (_env = new InputMap<string>());
            set => _env = value;
        }

        [Input("extraOptions")]
        private InputList<string>? _extraOptions;

        /// <summary>
        /// An optional catch-all list of arguments to provide extra CLI options to the docker build command.  For example `['--network', 'host']`.
        /// </summary>
        public InputList<string> ExtraOptions
        {
            get => _extraOptions ?? (_extraOptions = new InputList<string>());
            set => _extraOptions = value;
        }

        /// <summary>
        /// Path to a directory to use for the Docker build context, usually the directory in which the Dockerfile resides (although dockerfile may be used to choose a custom location independent of this choice). If not specified, the context defaults to the current working directory; if a relative path is used, it is relative to the current working directory that Pulumi is evaluating.
        /// </summary>
        [Input("path")]
        public Input<string>? Path { get; set; }

        /// <summary>
        /// Url of the repository
        /// </summary>
        [Input("repositoryUrl", required: true)]
        public Input<string> RepositoryUrl { get; set; } = null!;

        /// <summary>
        /// The target of the dockerfile to build
        /// </summary>
        [Input("target")]
        public Input<string>? Target { get; set; }

        public ImageArgs()
        {
        }
    }
}
