@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
195 lines • 7.67 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, { ...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?.arn;
resourceInputs["autoScalingConfigurationArn"] = state?.autoScalingConfigurationArn;
resourceInputs["encryptionConfiguration"] = state?.encryptionConfiguration;
resourceInputs["healthCheckConfiguration"] = state?.healthCheckConfiguration;
resourceInputs["instanceConfiguration"] = state?.instanceConfiguration;
resourceInputs["networkConfiguration"] = state?.networkConfiguration;
resourceInputs["observabilityConfiguration"] = state?.observabilityConfiguration;
resourceInputs["region"] = state?.region;
resourceInputs["serviceId"] = state?.serviceId;
resourceInputs["serviceName"] = state?.serviceName;
resourceInputs["serviceUrl"] = state?.serviceUrl;
resourceInputs["sourceConfiguration"] = state?.sourceConfiguration;
resourceInputs["status"] = state?.status;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.serviceName === undefined && !opts.urn) {
throw new Error("Missing required property 'serviceName'");
}
if (args?.sourceConfiguration === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceConfiguration'");
}
resourceInputs["autoScalingConfigurationArn"] = args?.autoScalingConfigurationArn;
resourceInputs["encryptionConfiguration"] = args?.encryptionConfiguration;
resourceInputs["healthCheckConfiguration"] = args?.healthCheckConfiguration;
resourceInputs["instanceConfiguration"] = args?.instanceConfiguration;
resourceInputs["networkConfiguration"] = args?.networkConfiguration;
resourceInputs["observabilityConfiguration"] = args?.observabilityConfiguration;
resourceInputs["region"] = args?.region;
resourceInputs["serviceName"] = args?.serviceName;
resourceInputs["sourceConfiguration"] = args?.sourceConfiguration;
resourceInputs["tags"] = args?.tags;
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
;