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

com.amazonaws.services.apprunner.model.CodeConfigurationValues Maven / Gradle / Ivy

/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.apprunner.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* Describes the basic configuration needed for building and running an App Runner service. This type doesn't support * the full set of possible configuration options. Fur full configuration capabilities, use a * apprunner.yaml file in the source code repository. *

* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CodeConfigurationValues implements Serializable, Cloneable, StructuredPojo { /** *

* A runtime environment type for building and running an App Runner service. It represents a programming language * runtime. *

*/ private String runtime; /** *

* The command App Runner runs to build your application. *

*/ private String buildCommand; /** *

* The command App Runner runs to start your application. *

*/ private String startCommand; /** *

* The port that your application listens to in the container. *

*

* Default: 8080 *

*/ private String port; /** *

* The environment variables that are available to your running App Runner service. An array of key-value pairs. *

*/ private java.util.Map runtimeEnvironmentVariables; /** *

* An array of key-value pairs representing the secrets and parameters that get referenced to your service as an * environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager * secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store. *

* *
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services * Region as the service that you're launching, you can use either the full ARN or name of the secret. If the * parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is not * supported. *

    *
  • *
*
*/ private java.util.Map runtimeEnvironmentSecrets; /** *

* A runtime environment type for building and running an App Runner service. It represents a programming language * runtime. *

* * @param runtime * A runtime environment type for building and running an App Runner service. It represents a programming * language runtime. * @see Runtime */ public void setRuntime(String runtime) { this.runtime = runtime; } /** *

* A runtime environment type for building and running an App Runner service. It represents a programming language * runtime. *

* * @return A runtime environment type for building and running an App Runner service. It represents a programming * language runtime. * @see Runtime */ public String getRuntime() { return this.runtime; } /** *

* A runtime environment type for building and running an App Runner service. It represents a programming language * runtime. *

* * @param runtime * A runtime environment type for building and running an App Runner service. It represents a programming * language runtime. * @return Returns a reference to this object so that method calls can be chained together. * @see Runtime */ public CodeConfigurationValues withRuntime(String runtime) { setRuntime(runtime); return this; } /** *

* A runtime environment type for building and running an App Runner service. It represents a programming language * runtime. *

* * @param runtime * A runtime environment type for building and running an App Runner service. It represents a programming * language runtime. * @return Returns a reference to this object so that method calls can be chained together. * @see Runtime */ public CodeConfigurationValues withRuntime(Runtime runtime) { this.runtime = runtime.toString(); return this; } /** *

* The command App Runner runs to build your application. *

* * @param buildCommand * The command App Runner runs to build your application. */ public void setBuildCommand(String buildCommand) { this.buildCommand = buildCommand; } /** *

* The command App Runner runs to build your application. *

* * @return The command App Runner runs to build your application. */ public String getBuildCommand() { return this.buildCommand; } /** *

* The command App Runner runs to build your application. *

* * @param buildCommand * The command App Runner runs to build your application. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues withBuildCommand(String buildCommand) { setBuildCommand(buildCommand); return this; } /** *

* The command App Runner runs to start your application. *

* * @param startCommand * The command App Runner runs to start your application. */ public void setStartCommand(String startCommand) { this.startCommand = startCommand; } /** *

* The command App Runner runs to start your application. *

* * @return The command App Runner runs to start your application. */ public String getStartCommand() { return this.startCommand; } /** *

* The command App Runner runs to start your application. *

* * @param startCommand * The command App Runner runs to start your application. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues withStartCommand(String startCommand) { setStartCommand(startCommand); return this; } /** *

* The port that your application listens to in the container. *

*

* Default: 8080 *

* * @param port * The port that your application listens to in the container.

*

* Default: 8080 */ public void setPort(String port) { this.port = port; } /** *

* The port that your application listens to in the container. *

*

* Default: 8080 *

* * @return The port that your application listens to in the container.

*

* Default: 8080 */ public String getPort() { return this.port; } /** *

* The port that your application listens to in the container. *

*

* Default: 8080 *

* * @param port * The port that your application listens to in the container.

*

* Default: 8080 * @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues withPort(String port) { setPort(port); return this; } /** *

* The environment variables that are available to your running App Runner service. An array of key-value pairs. *

* * @return The environment variables that are available to your running App Runner service. An array of key-value * pairs. */ public java.util.Map getRuntimeEnvironmentVariables() { return runtimeEnvironmentVariables; } /** *

* The environment variables that are available to your running App Runner service. An array of key-value pairs. *

* * @param runtimeEnvironmentVariables * The environment variables that are available to your running App Runner service. An array of key-value * pairs. */ public void setRuntimeEnvironmentVariables(java.util.Map runtimeEnvironmentVariables) { this.runtimeEnvironmentVariables = runtimeEnvironmentVariables; } /** *

* The environment variables that are available to your running App Runner service. An array of key-value pairs. *

* * @param runtimeEnvironmentVariables * The environment variables that are available to your running App Runner service. An array of key-value * pairs. * @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues withRuntimeEnvironmentVariables(java.util.Map runtimeEnvironmentVariables) { setRuntimeEnvironmentVariables(runtimeEnvironmentVariables); return this; } /** * Add a single RuntimeEnvironmentVariables entry * * @see CodeConfigurationValues#withRuntimeEnvironmentVariables * @returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues addRuntimeEnvironmentVariablesEntry(String key, String value) { if (null == this.runtimeEnvironmentVariables) { this.runtimeEnvironmentVariables = new java.util.HashMap(); } if (this.runtimeEnvironmentVariables.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.runtimeEnvironmentVariables.put(key, value); return this; } /** * Removes all the entries added into RuntimeEnvironmentVariables. * * @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues clearRuntimeEnvironmentVariablesEntries() { this.runtimeEnvironmentVariables = null; return this; } /** *

* An array of key-value pairs representing the secrets and parameters that get referenced to your service as an * environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager * secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store. *

* *
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services * Region as the service that you're launching, you can use either the full ARN or name of the secret. If the * parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is not * supported. *

    *
  • *
*
* * @return An array of key-value pairs representing the secrets and parameters that get referenced to your service * as an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the * Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager * Parameter Store.

*
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web * Services Region as the service that you're launching, you can use either the full ARN or name of the * secret. If the parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is * not supported. *

    *
  • *
*/ public java.util.Map getRuntimeEnvironmentSecrets() { return runtimeEnvironmentSecrets; } /** *

* An array of key-value pairs representing the secrets and parameters that get referenced to your service as an * environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager * secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store. *

* *
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services * Region as the service that you're launching, you can use either the full ARN or name of the secret. If the * parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is not * supported. *

    *
  • *
*
* * @param runtimeEnvironmentSecrets * An array of key-value pairs representing the secrets and parameters that get referenced to your service as * an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the * Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager * Parameter Store.

*
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web * Services Region as the service that you're launching, you can use either the full ARN or name of the * secret. If the parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is * not supported. *

    *
  • *
*/ public void setRuntimeEnvironmentSecrets(java.util.Map runtimeEnvironmentSecrets) { this.runtimeEnvironmentSecrets = runtimeEnvironmentSecrets; } /** *

* An array of key-value pairs representing the secrets and parameters that get referenced to your service as an * environment variable. The supported values are either the full Amazon Resource Name (ARN) of the Secrets Manager * secret or the full ARN of the parameter in the Amazon Web Services Systems Manager Parameter Store. *

* *
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web Services * Region as the service that you're launching, you can use either the full ARN or name of the secret. If the * parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is not * supported. *

    *
  • *
*
* * @param runtimeEnvironmentSecrets * An array of key-value pairs representing the secrets and parameters that get referenced to your service as * an environment variable. The supported values are either the full Amazon Resource Name (ARN) of the * Secrets Manager secret or the full ARN of the parameter in the Amazon Web Services Systems Manager * Parameter Store.

*
    *
  • *

    * If the Amazon Web Services Systems Manager Parameter Store parameter exists in the same Amazon Web * Services Region as the service that you're launching, you can use either the full ARN or name of the * secret. If the parameter exists in a different Region, then the full ARN must be specified. *

    *
  • *
  • *

    * Currently, cross account referencing of Amazon Web Services Systems Manager Parameter Store parameter is * not supported. *

    *
  • *
* @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues withRuntimeEnvironmentSecrets(java.util.Map runtimeEnvironmentSecrets) { setRuntimeEnvironmentSecrets(runtimeEnvironmentSecrets); return this; } /** * Add a single RuntimeEnvironmentSecrets entry * * @see CodeConfigurationValues#withRuntimeEnvironmentSecrets * @returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues addRuntimeEnvironmentSecretsEntry(String key, String value) { if (null == this.runtimeEnvironmentSecrets) { this.runtimeEnvironmentSecrets = new java.util.HashMap(); } if (this.runtimeEnvironmentSecrets.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.runtimeEnvironmentSecrets.put(key, value); return this; } /** * Removes all the entries added into RuntimeEnvironmentSecrets. * * @return Returns a reference to this object so that method calls can be chained together. */ public CodeConfigurationValues clearRuntimeEnvironmentSecretsEntries() { this.runtimeEnvironmentSecrets = null; return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getRuntime() != null) sb.append("Runtime: ").append(getRuntime()).append(","); if (getBuildCommand() != null) sb.append("BuildCommand: ").append("***Sensitive Data Redacted***").append(","); if (getStartCommand() != null) sb.append("StartCommand: ").append("***Sensitive Data Redacted***").append(","); if (getPort() != null) sb.append("Port: ").append(getPort()).append(","); if (getRuntimeEnvironmentVariables() != null) sb.append("RuntimeEnvironmentVariables: ").append("***Sensitive Data Redacted***").append(","); if (getRuntimeEnvironmentSecrets() != null) sb.append("RuntimeEnvironmentSecrets: ").append("***Sensitive Data Redacted***"); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CodeConfigurationValues == false) return false; CodeConfigurationValues other = (CodeConfigurationValues) obj; if (other.getRuntime() == null ^ this.getRuntime() == null) return false; if (other.getRuntime() != null && other.getRuntime().equals(this.getRuntime()) == false) return false; if (other.getBuildCommand() == null ^ this.getBuildCommand() == null) return false; if (other.getBuildCommand() != null && other.getBuildCommand().equals(this.getBuildCommand()) == false) return false; if (other.getStartCommand() == null ^ this.getStartCommand() == null) return false; if (other.getStartCommand() != null && other.getStartCommand().equals(this.getStartCommand()) == false) return false; if (other.getPort() == null ^ this.getPort() == null) return false; if (other.getPort() != null && other.getPort().equals(this.getPort()) == false) return false; if (other.getRuntimeEnvironmentVariables() == null ^ this.getRuntimeEnvironmentVariables() == null) return false; if (other.getRuntimeEnvironmentVariables() != null && other.getRuntimeEnvironmentVariables().equals(this.getRuntimeEnvironmentVariables()) == false) return false; if (other.getRuntimeEnvironmentSecrets() == null ^ this.getRuntimeEnvironmentSecrets() == null) return false; if (other.getRuntimeEnvironmentSecrets() != null && other.getRuntimeEnvironmentSecrets().equals(this.getRuntimeEnvironmentSecrets()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRuntime() == null) ? 0 : getRuntime().hashCode()); hashCode = prime * hashCode + ((getBuildCommand() == null) ? 0 : getBuildCommand().hashCode()); hashCode = prime * hashCode + ((getStartCommand() == null) ? 0 : getStartCommand().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); hashCode = prime * hashCode + ((getRuntimeEnvironmentVariables() == null) ? 0 : getRuntimeEnvironmentVariables().hashCode()); hashCode = prime * hashCode + ((getRuntimeEnvironmentSecrets() == null) ? 0 : getRuntimeEnvironmentSecrets().hashCode()); return hashCode; } @Override public CodeConfigurationValues clone() { try { return (CodeConfigurationValues) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.apprunner.model.transform.CodeConfigurationValuesMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy