Configuration

class Configuration : KotlinCustomResource

Manages the configuration for a Nginx Deployment.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.PublicIp;
import com.pulumi.azure.network.PublicIpArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
import com.pulumi.azure.nginx.Deployment;
import com.pulumi.azure.nginx.DeploymentArgs;
import com.pulumi.azure.nginx.inputs.DeploymentFrontendPublicArgs;
import com.pulumi.azure.nginx.inputs.DeploymentNetworkInterfaceArgs;
import com.pulumi.azure.nginx.Configuration;
import com.pulumi.azure.nginx.ConfigurationArgs;
import com.pulumi.azure.nginx.inputs.ConfigurationConfigFileArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-rg")
.location("West Europe")
.build());
var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
.name("example")
.resourceGroupName(example.name())
.location(example.location())
.allocationMethod("Static")
.sku("Standard")
.tags(Map.of("environment", "Production"))
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("example-vnet")
.addressSpaces("10.0.0.0/16")
.location(example.location())
.resourceGroupName(example.name())
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.name("example-subnet")
.resourceGroupName(example.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.delegations(SubnetDelegationArgs.builder()
.name("delegation")
.serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
.name("NGINX.NGINXPLUS/nginxDeployments")
.actions("Microsoft.Network/virtualNetworks/subnets/join/action")
.build())
.build())
.build());
var exampleDeployment = new Deployment("exampleDeployment", DeploymentArgs.builder()
.name("example-nginx")
.resourceGroupName(example.name())
.sku("publicpreview_Monthly_gmz7xq9ge3py")
.location(example.location())
.managedResourceGroup("example")
.diagnoseSupportEnabled(true)
.frontendPublic(DeploymentFrontendPublicArgs.builder()
.ipAddresses(examplePublicIp.id())
.build())
.networkInterfaces(DeploymentNetworkInterfaceArgs.builder()
.subnetId(exampleSubnet.id())
.build())
.build());
var exampleConfiguration = new Configuration("exampleConfiguration", ConfigurationArgs.builder()
.nginxDeploymentId(exampleDeployment.id())
.rootFile("/etc/nginx/nginx.conf")
.configFiles(
ConfigurationConfigFileArgs.builder()
.content(StdFunctions.base64encode(Base64encodeArgs.builder()
.input("""
http {
server {
listen 80;
location / {
default_type text/html;
return 200 '<!doctype html><html lang="en"><head></head><body>
<div>this one will be updated</div>
<div>at 10:38 am</div>
</body></html>';
}
include site/*.conf;
}
}
""")
.build()).result())
.virtualPath("/etc/nginx/nginx.conf")
.build(),
ConfigurationConfigFileArgs.builder()
.content(StdFunctions.base64encode(Base64encodeArgs.builder()
.input("""
location /bbb {
default_type text/html;
return 200 '<!doctype html><html lang="en"><head></head><body>
<div>this one will be updated</div>
<div>at 10:38 am</div>
</body></html>';
}
""")
.build()).result())
.virtualPath("/etc/nginx/site/b.conf")
.build())
.build());
}
}

Import

An Nginx Configuration can be imported using the resource id, e.g.

$ pulumi import azure:nginx/configuration:Configuration example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Nginx.NginxPlus/nginxDeployments/dep1/configurations/default

*/

Properties

Link copied to clipboard

One or more config_file blocks as defined below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The ID of the Nginx Deployment. Changing this forces a new Nginx Configuration to be created.

Link copied to clipboard
val packageData: Output<String>?

Specify the package data for this configuration.

Link copied to clipboard

One or more protected_file blocks with sensitive information as defined below. If specified config_file must also be specified.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val rootFile: Output<String>

Specify the root file path of this Nginx Configuration.

Link copied to clipboard
val urn: Output<String>