@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
195 lines • 8.18 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Service = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an App Runner Service.
*
* ## Example Usage
*
* ### Service with a Code Repository Source
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.apprunner.Service("example", {
* serviceName: "example",
* sourceConfiguration: {
* authenticationConfiguration: {
* connectionArn: exampleAwsApprunnerConnection.arn,
* },
* codeRepository: {
* codeConfiguration: {
* codeConfigurationValues: {
* buildCommand: "python setup.py develop",
* port: "8000",
* runtime: "PYTHON_3",
* startCommand: "python runapp.py",
* },
* configurationSource: "API",
* },
* repositoryUrl: "https://github.com/example/my-example-python-app",
* sourceCodeVersion: {
* type: "BRANCH",
* value: "main",
* },
* },
* },
* networkConfiguration: {
* egressConfiguration: {
* egressType: "VPC",
* vpcConnectorArn: connector.arn,
* },
* },
* tags: {
* Name: "example-apprunner-service",
* },
* });
* ```
*
* ### Service with an Image Repository Source
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.apprunner.Service("example", {
* serviceName: "example",
* sourceConfiguration: {
* imageRepository: {
* imageConfiguration: {
* port: "8000",
* },
* imageIdentifier: "public.ecr.aws/aws-containers/hello-app-runner:latest",
* imageRepositoryType: "ECR_PUBLIC",
* },
* autoDeploymentsEnabled: false,
* },
* tags: {
* Name: "example-apprunner-service",
* },
* });
* ```
*
* ### Service with Observability Configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleObservabilityConfiguration = new aws.apprunner.ObservabilityConfiguration("example", {
* observabilityConfigurationName: "example",
* traceConfiguration: {
* vendor: "AWSXRAY",
* },
* });
* const example = new aws.apprunner.Service("example", {
* serviceName: "example",
* observabilityConfiguration: {
* observabilityConfigurationArn: exampleObservabilityConfiguration.arn,
* observabilityEnabled: true,
* },
* sourceConfiguration: {
* imageRepository: {
* imageConfiguration: {
* port: "8000",
* },
* imageIdentifier: "public.ecr.aws/aws-containers/hello-app-runner:latest",
* imageRepositoryType: "ECR_PUBLIC",
* },
* autoDeploymentsEnabled: false,
* },
* tags: {
* Name: "example-apprunner-service",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import App Runner Services using the `arn`. For example:
*
* ```sh
* $ pulumi import aws:apprunner/service:Service example arn:aws:apprunner:us-east-1:1234567890:service/example/0a03292a89764e5882c41d8f991c82fe
* ```
*/
class Service extends pulumi.CustomResource {
/**
* Get an existing Service resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new Service(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Service. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Service.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["autoScalingConfigurationArn"] = state ? state.autoScalingConfigurationArn : undefined;
resourceInputs["encryptionConfiguration"] = state ? state.encryptionConfiguration : undefined;
resourceInputs["healthCheckConfiguration"] = state ? state.healthCheckConfiguration : undefined;
resourceInputs["instanceConfiguration"] = state ? state.instanceConfiguration : undefined;
resourceInputs["networkConfiguration"] = state ? state.networkConfiguration : undefined;
resourceInputs["observabilityConfiguration"] = state ? state.observabilityConfiguration : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["serviceId"] = state ? state.serviceId : undefined;
resourceInputs["serviceName"] = state ? state.serviceName : undefined;
resourceInputs["serviceUrl"] = state ? state.serviceUrl : undefined;
resourceInputs["sourceConfiguration"] = state ? state.sourceConfiguration : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.serviceName === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceName'");
}
if ((!args || args.sourceConfiguration === undefined) && !opts.urn) {
throw new Error("Missing required property 'sourceConfiguration'");
}
resourceInputs["autoScalingConfigurationArn"] = args ? args.autoScalingConfigurationArn : undefined;
resourceInputs["encryptionConfiguration"] = args ? args.encryptionConfiguration : undefined;
resourceInputs["healthCheckConfiguration"] = args ? args.healthCheckConfiguration : undefined;
resourceInputs["instanceConfiguration"] = args ? args.instanceConfiguration : undefined;
resourceInputs["networkConfiguration"] = args ? args.networkConfiguration : undefined;
resourceInputs["observabilityConfiguration"] = args ? args.observabilityConfiguration : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["serviceName"] = args ? args.serviceName : undefined;
resourceInputs["sourceConfiguration"] = args ? args.sourceConfiguration : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["serviceId"] = undefined /*out*/;
resourceInputs["serviceUrl"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Service.__pulumiType, name, resourceInputs, opts);
}
}
exports.Service = Service;
/** @internal */
Service.__pulumiType = 'aws:apprunner/service:Service';
//# sourceMappingURL=service.js.map