Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "pulumi"]
path = pulumi
url = https://github.com/pulumi/pulumi
branch = v3.220.0
branch = v3.223.0
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ lint_pkg.fix: lint_pkg_dependencies
.PHONY: lint_pkg_dependencies
lint_pkg_dependencies:
@cd pkg || exit 1; \
PKG=$$(grep -r '"github.com/pulumi/pulumi/pkg/v3/[^codegen]' .); \
if [ "$$?" -eq 0 ] ; then \
echo "Cannot use pkg except for codegen.";\
PKG=$$(grep -r '"github.com/pulumi/pulumi/pkg/v3/' . | grep -v 'codegen' | grep -v 'testing'); \
if [ -n "$$PKG" ] ; then \
echo "Cannot use pkg except for codegen and testing.";\
echo "Found $$PKG";\
exit 1; \
fi
Expand Down
11 changes: 10 additions & 1 deletion pkg/cmd/pulumi-language-java/language_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,18 @@ var expectedFailures = map[string]string{
"l3-range-resource-output-traversal": "https://github.com/pulumi/pulumi-java/issues/1997",
"l2-resource-option-plugin-download-url": "https://github.com/pulumi/pulumi-java/issues/1999",
"l2-resource-option-env-var-mappings": "https://github.com/pulumi/pulumi-java/issues/2006",
"l1-elide-index": "https://github.com/pulumi/pulumi-java/issues/2017",
"l2-elide-index": "https://github.com/pulumi/pulumi-java/issues/2016",
"l2-enum": "https://github.com/pulumi/pulumi-java/issues/2018",
"l2-module-format": "https://github.com/pulumi/pulumi-java/issues/2019",
"l2-resource-names": "https://github.com/pulumi/pulumi-java/issues/2020",
"l2-discriminated-union": "https://github.com/pulumi/pulumi-java/issues/2021",
"policy-stack-tags": "https://github.com/pulumi/pulumi-java/issues/2022",
"provider-resource-component": "not implemented",
"provider-alias-component": "not implemented",
"provider-replacement-trigger-component": "https://github.com/pulumi/pulumi-java/issues/2007",
"provider-depends-on-component": "https://github.com/pulumi/pulumi-java/issues/2023",
"provider-ignore-changes-component": "https://github.com/pulumi/pulumi-java/issues/2024",
}

// runTestingHost boots up a new instance of the language conformance test runner, `pulumi-test-language`, as well as a
Expand All @@ -253,7 +262,7 @@ func runTestingHost(t *testing.T) (string, testingrpc.LanguageTestClient) {
// We can't just go run the pulumi-test-language package because of
// https://github.com/golang/go/issues/39172, so we build it to a temp file then run that.
binary := t.TempDir() + "/pulumi-test-language"
cmd := exec.Command("go", "build", "-C", "../../../pulumi/cmd/pulumi-test-language", "-o", binary)
cmd := exec.Command("go", "build", "-o", binary, "github.com/pulumi/pulumi/pkg/v3/testing/pulumi-test-language") //nolint:gosec,lll
output, err := cmd.CombinedOutput()
t.Logf("build output: %s", output)
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: l2-resource-order
runtime: java
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.pulumi</groupId>
<artifactId>l2-resource-order</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<encoding>UTF-8</encoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<mainClass>generated_program.App</mainClass>
<mainArgs/>
</properties>

<repositories>
<repository>
<id>repository-0</id>
<url>REPOSITORY</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.pulumi</groupId>
<artifactId>pulumi</artifactId>
<version>CORE.VERSION</version>
</dependency>
<dependency>
<groupId>com.pulumi</groupId>
<artifactId>simple</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>${mainClass}</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-my-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<mainClass>${mainClass}</mainClass>
<commandlineArgs>${mainArgs}</commandlineArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-wrapper-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<mavenVersion>3.8.5</mavenVersion>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.simple.Resource;
import com.pulumi.simple.ResourceArgs;
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 res1 = new Resource("res1", ResourceArgs.builder()
.value(true)
.build());

final var localVar = res1.value();

var res2 = new Resource("res2", ResourceArgs.builder()
.value(localVar)
.build());

ctx.export("out", res2.value());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.FrontDoor;
import com.pulumi.azurenative.network.FrontDoorArgs;
import com.pulumi.azurenative.network.inputs.RoutingRuleArgs;
import com.pulumi.azurenative.cdn.Endpoint;
import com.pulumi.azurenative.cdn.EndpointArgs;
import com.pulumi.azurenative.cdn.inputs.EndpointPropertiesUpdateParametersDeliveryPolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
Expand All @@ -23,62 +21,56 @@ public static void main(String[] args) {

public static void stack(Context ctx) {
var frontDoor = new FrontDoor("frontDoor", FrontDoorArgs.builder()
.routingRules(RoutingRuleArgs.builder()
.routeConfiguration(ForwardingConfigurationArgs.builder()
.odataType("#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration")
.backendPool(SubResourceArgs.builder()
.id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/backendPools/backendPool1")
.build())
.build())
.build())
.routingRules(List.of(Map.of("routeConfiguration", Map.ofEntries(
Map.entry("odataType", "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration"),
Map.entry("backendPool", Map.of("id", "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/frontDoors/frontDoor1/backendPools/backendPool1"))
))))
.build());

var endpoint = new Endpoint("endpoint", EndpointArgs.builder()
.deliveryPolicy(EndpointPropertiesUpdateParametersDeliveryPolicyArgs.builder()
.rules(DeliveryRuleArgs.builder()
.actions(
DeliveryRuleCacheExpirationActionArgs.builder()
.name("CacheExpiration")
.parameters(CacheExpirationActionParametersArgs.builder()
.cacheBehavior("Override")
.cacheDuration("10:10:09")
.cacheType("All")
.odataType("#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters")
.build())
.build(),
DeliveryRuleResponseHeaderActionArgs.builder()
.name("ModifyResponseHeader")
.parameters(HeaderActionParametersArgs.builder()
.headerAction("Overwrite")
.headerName("Access-Control-Allow-Origin")
.odataType("#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters")
.value("*")
.build())
.build(),
DeliveryRuleRequestHeaderActionArgs.builder()
.name("ModifyRequestHeader")
.parameters(HeaderActionParametersArgs.builder()
.headerAction("Overwrite")
.headerName("Accept-Encoding")
.odataType("#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters")
.value("gzip")
.build())
.build())
.conditions(DeliveryRuleRemoteAddressConditionArgs.builder()
.name("RemoteAddress")
.parameters(RemoteAddressMatchConditionParametersArgs.builder()
.matchValues(
"192.168.1.0/24",
"10.0.0.0/24")
.negateCondition(true)
.odataType("#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters")
.operator("IPMatch")
.build())
.build())
.name("rule1")
.order(1)
.build())
.build())
.deliveryPolicy(Map.of("rules", List.of(Map.ofEntries(
Map.entry("actions", List.of(
Map.ofEntries(
Map.entry("name", "CacheExpiration"),
Map.entry("parameters", Map.ofEntries(
Map.entry("cacheBehavior", "Override"),
Map.entry("cacheDuration", "10:10:09"),
Map.entry("cacheType", "All"),
Map.entry("odataType", "#Microsoft.Azure.Cdn.Models.DeliveryRuleCacheExpirationActionParameters")
))
),
Map.ofEntries(
Map.entry("name", "ModifyResponseHeader"),
Map.entry("parameters", Map.ofEntries(
Map.entry("headerAction", "Overwrite"),
Map.entry("headerName", "Access-Control-Allow-Origin"),
Map.entry("odataType", "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters"),
Map.entry("value", "*")
))
),
Map.ofEntries(
Map.entry("name", "ModifyRequestHeader"),
Map.entry("parameters", Map.ofEntries(
Map.entry("headerAction", "Overwrite"),
Map.entry("headerName", "Accept-Encoding"),
Map.entry("odataType", "#Microsoft.Azure.Cdn.Models.DeliveryRuleHeaderActionParameters"),
Map.entry("value", "gzip")
))
))),
Map.entry("conditions", List.of(Map.ofEntries(
Map.entry("name", "RemoteAddress"),
Map.entry("parameters", Map.ofEntries(
Map.entry("matchValues", List.of(
"192.168.1.0/24",
"10.0.0.0/24")),
Map.entry("negateCondition", true),
Map.entry("odataType", "#Microsoft.Azure.Cdn.Models.DeliveryRuleRemoteAddressConditionParameters"),
Map.entry("operator", "IPMatch")
))
))),
Map.entry("name", "rule1"),
Map.entry("order", 1)
))))
.endpointName("endpoint1")
.isCompressionEnabled(true)
.isHttpAllowed(true)
Expand Down
Loading
Loading