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

software.amazon.awscdk.services.ecs.AwsLogDriver Maven / Gradle / Ivy

package software.amazon.awscdk.services.ecs;

/**
 * A log driver that sends log information to CloudWatch Logs.
 */
@javax.annotation.Generated(value = "jsii-pacmak/0.20.2 (build faba0be)", date = "2019-11-11T17:18:01.422Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ecs.$Module.class, fqn = "@aws-cdk/aws-ecs.AwsLogDriver")
public class AwsLogDriver extends software.amazon.awscdk.services.ecs.LogDriver {

    protected AwsLogDriver(final software.amazon.jsii.JsiiObjectRef objRef) {
        super(objRef);
    }

    protected AwsLogDriver(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
        super(initializationMode);
    }

    /**
     * Constructs a new instance of the AwsLogDriver class.
     * 
     * @param props the awslogs log driver configuration options. This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public AwsLogDriver(final software.amazon.awscdk.services.ecs.AwsLogDriverProps props) {
        super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
        software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(props, "props is required") });
    }

    /**
     * Called when the log driver is configured on a container.
     * 
     * @param scope This parameter is required.
     * @param containerDefinition This parameter is required.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    @Override
    public software.amazon.awscdk.services.ecs.LogDriverConfig bind(final software.amazon.awscdk.core.Construct scope, final software.amazon.awscdk.services.ecs.ContainerDefinition containerDefinition) {
        return this.jsiiCall("bind", software.amazon.awscdk.services.ecs.LogDriverConfig.class, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(containerDefinition, "containerDefinition is required") });
    }

    /**
     * The log group to send log streams to.
     * 
     * Only available after the LogDriver has been bound to a ContainerDefinition.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public software.amazon.awscdk.services.logs.ILogGroup getLogGroup() {
        return this.jsiiGet("logGroup", software.amazon.awscdk.services.logs.ILogGroup.class);
    }

    /**
     * The log group to send log streams to.
     * 
     * Only available after the LogDriver has been bound to a ContainerDefinition.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public void setLogGroup(final software.amazon.awscdk.services.logs.ILogGroup value) {
        this.jsiiSet("logGroup", value);
    }

    /**
     * A fluent builder for {@link software.amazon.awscdk.services.ecs.AwsLogDriver}.
     */
    @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
    public static final class Builder {
        /**
         * @return a new instance of {@link Builder}.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public static Builder create() {
            return new Builder();
        }

        private final software.amazon.awscdk.services.ecs.AwsLogDriverProps.Builder props;

        private Builder() {
            this.props = new software.amazon.awscdk.services.ecs.AwsLogDriverProps.Builder();
        }

        /**
         * @return {@code this}
         * @param streamPrefix Prefix for the log streams. This parameter is required.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public Builder streamPrefix(final java.lang.String streamPrefix) {
            this.props.streamPrefix(streamPrefix);
            return this;
        }

        /**
         * @return {@code this}
         * @param datetimeFormat This option defines a multiline start pattern in Python strftime format. This parameter is required.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public Builder datetimeFormat(final java.lang.String datetimeFormat) {
            this.props.datetimeFormat(datetimeFormat);
            return this;
        }

        /**
         * @return {@code this}
         * @param logGroup The log group to log to. This parameter is required.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public Builder logGroup(final software.amazon.awscdk.services.logs.ILogGroup logGroup) {
            this.props.logGroup(logGroup);
            return this;
        }

        /**
         * @return {@code this}
         * @param logRetention The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct. This parameter is required.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public Builder logRetention(final software.amazon.awscdk.services.logs.RetentionDays logRetention) {
            this.props.logRetention(logRetention);
            return this;
        }

        /**
         * @return {@code this}
         * @param multilinePattern This option defines a multiline start pattern using a regular expression. This parameter is required.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public Builder multilinePattern(final java.lang.String multilinePattern) {
            this.props.multilinePattern(multilinePattern);
            return this;
        }

        /**
         * @returns a newly built instance of {@link software.amazon.awscdk.services.ecs.AwsLogDriver}.
         */
        @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
        public software.amazon.awscdk.services.ecs.AwsLogDriver build() {
            return new software.amazon.awscdk.services.ecs.AwsLogDriver(
                this.props.build()
            );
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy