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

com.pulumi.aws.opsworks.kotlin.RailsAppLayer.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.opsworks.kotlin

import com.pulumi.aws.opsworks.kotlin.outputs.RailsAppLayerCloudwatchConfiguration
import com.pulumi.aws.opsworks.kotlin.outputs.RailsAppLayerEbsVolume
import com.pulumi.aws.opsworks.kotlin.outputs.RailsAppLayerLoadBasedAutoScaling
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.aws.opsworks.kotlin.outputs.RailsAppLayerCloudwatchConfiguration.Companion.toKotlin as railsAppLayerCloudwatchConfigurationToKotlin
import com.pulumi.aws.opsworks.kotlin.outputs.RailsAppLayerEbsVolume.Companion.toKotlin as railsAppLayerEbsVolumeToKotlin
import com.pulumi.aws.opsworks.kotlin.outputs.RailsAppLayerLoadBasedAutoScaling.Companion.toKotlin as railsAppLayerLoadBasedAutoScalingToKotlin

/**
 * Builder for [RailsAppLayer].
 */
@PulumiTagMarker
public class RailsAppLayerResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: RailsAppLayerArgs = RailsAppLayerArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend RailsAppLayerArgsBuilder.() -> Unit) {
        val builder = RailsAppLayerArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): RailsAppLayer {
        val builtJavaResource = com.pulumi.aws.opsworks.RailsAppLayer(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return RailsAppLayer(builtJavaResource)
    }
}

/**
 * Provides an OpsWorks Ruby on Rails application layer resource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const app = new aws.opsworks.RailsAppLayer("app", {stackId: main.id});
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * app = aws.opsworks.RailsAppLayer("app", stack_id=main["id"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var app = new Aws.OpsWorks.RailsAppLayer("app", new()
 *     {
 *         StackId = main.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opsworks"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := opsworks.NewRailsAppLayer(ctx, "app", &opsworks.RailsAppLayerArgs{
 * 			StackId: pulumi.Any(main.Id),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.opsworks.RailsAppLayer;
 * import com.pulumi.aws.opsworks.RailsAppLayerArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var app = new RailsAppLayer("app", RailsAppLayerArgs.builder()
 *             .stackId(main.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   app:
 *     type: aws:opsworks:RailsAppLayer
 *     properties:
 *       stackId: ${main.id}
 * ```
 * 
 */
public class RailsAppLayer internal constructor(
    override val javaResource: com.pulumi.aws.opsworks.RailsAppLayer,
) : KotlinCustomResource(javaResource, RailsAppLayerMapper) {
    /**
     * Keyword for the app server to use. Defaults to "apache_passenger".
     */
    public val appServer: Output?
        get() = javaResource.appServer().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The Amazon Resource Name(ARN) of the layer.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * Whether to automatically assign an elastic IP address to the layer's instances.
     */
    public val autoAssignElasticIps: Output?
        get() = javaResource.autoAssignElasticIps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * For stacks belonging to a VPC, whether to automatically assign a public IP address to each of the layer's instances.
     */
    public val autoAssignPublicIps: Output?
        get() = javaResource.autoAssignPublicIps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Whether to enable auto-healing for the layer.
     */
    public val autoHealing: Output?
        get() = javaResource.autoHealing().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * When OpsWorks is managing Bundler, which version to use. Defaults to "1.5.3".
     */
    public val bundlerVersion: Output?
        get() = javaResource.bundlerVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val cloudwatchConfiguration: Output?
        get() = javaResource.cloudwatchConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> railsAppLayerCloudwatchConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    public val customConfigureRecipes: Output>?
        get() = javaResource.customConfigureRecipes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    public val customDeployRecipes: Output>?
        get() = javaResource.customDeployRecipes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * The ARN of an IAM profile that will be used for the layer's instances.
     */
    public val customInstanceProfileArn: Output?
        get() = javaResource.customInstanceProfileArn().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Custom JSON attributes to apply to the layer.
     */
    public val customJson: Output?
        get() = javaResource.customJson().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Ids for a set of security groups to apply to the layer's instances.
     */
    public val customSecurityGroupIds: Output>?
        get() = javaResource.customSecurityGroupIds().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    public val customSetupRecipes: Output>?
        get() = javaResource.customSetupRecipes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    public val customShutdownRecipes: Output>?
        get() = javaResource.customShutdownRecipes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    public val customUndeployRecipes: Output>?
        get() = javaResource.customUndeployRecipes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Whether to enable Elastic Load Balancing connection draining.
     */
    public val drainElbOnShutdown: Output?
        get() = javaResource.drainElbOnShutdown().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * `ebs_volume` blocks, as described below, will each create an EBS volume and connect it to the layer's instances.
     */
    public val ebsVolumes: Output>
        get() = javaResource.ebsVolumes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    railsAppLayerEbsVolumeToKotlin(args0)
                })
            })
        })

    /**
     * Name of an Elastic Load Balancer to attach to this layer
     */
    public val elasticLoadBalancer: Output?
        get() = javaResource.elasticLoadBalancer().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Whether to install OS and package updates on each instance when it boots.
     */
    public val installUpdatesOnBoot: Output?
        get() = javaResource.installUpdatesOnBoot().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The time, in seconds, that OpsWorks will wait for Chef to complete after triggering the Shutdown event.
     */
    public val instanceShutdownTimeout: Output?
        get() = javaResource.instanceShutdownTimeout().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val loadBasedAutoScaling: Output
        get() = javaResource.loadBasedAutoScaling().applyValue({ args0 ->
            args0.let({ args0 ->
                railsAppLayerLoadBasedAutoScalingToKotlin(args0)
            })
        })

    /**
     * Whether OpsWorks should manage bundler. On by default.
     */
    public val manageBundler: Output?
        get() = javaResource.manageBundler().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A human-readable name for the layer.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The version of Passenger to use. Defaults to "4.0.46".
     */
    public val passengerVersion: Output?
        get() = javaResource.passengerVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The version of Ruby to use. Defaults to "2.0.0".
     */
    public val rubyVersion: Output?
        get() = javaResource.rubyVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The version of RubyGems to use. Defaults to "2.2.2".
     */
    public val rubygemsVersion: Output?
        get() = javaResource.rubygemsVersion().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * ID of the stack the layer will belong to.
     */
    public val stackId: Output
        get() = javaResource.stackId().applyValue({ args0 -> args0 })

    /**
     * Names of a set of system packages to install on the layer's instances.
     */
    public val systemPackages: Output>?
        get() = javaResource.systemPackages().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * A map of tags to assign to the resource. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     * The following extra optional arguments, all lists of Chef recipe names, allow
     * custom Chef recipes to be applied to layer instances at the five different
     * lifecycle events, if custom cookbooks are enabled on the layer's stack:
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
     */
    @Deprecated(
        message = """
  Please use `tags` instead.
  """,
    )
    public val tagsAll: Output>
        get() = javaResource.tagsAll().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * Whether to use EBS-optimized instances.
     */
    public val useEbsOptimizedInstances: Output?
        get() = javaResource.useEbsOptimizedInstances().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })
}

public object RailsAppLayerMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.opsworks.RailsAppLayer::class == javaResource::class

    override fun map(javaResource: Resource): RailsAppLayer = RailsAppLayer(
        javaResource as
            com.pulumi.aws.opsworks.RailsAppLayer,
    )
}

/**
 * @see [RailsAppLayer].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [RailsAppLayer].
 */
public suspend fun railsAppLayer(
    name: String,
    block: suspend RailsAppLayerResourceBuilder.() -> Unit,
): RailsAppLayer {
    val builder = RailsAppLayerResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [RailsAppLayer].
 * @param name The _unique_ name of the resulting resource.
 */
public fun railsAppLayer(name: String): RailsAppLayer {
    val builder = RailsAppLayerResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy