-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pulumi Java - Examples with Map(java.Map) not working #1039
Comments
Hi @marctree, thank you for taking the time to file the issue 🙏 the example in our docs is auto-generated by our codegen tooling. The java code generator still has issues and this is one of them. It generates a The correct code should look like the following snippet which uses the appropriate types: package myproject;
import com.pulumi.Pulumi;
import com.pulumi.azurenative.resources.ResourceGroup;
import com.pulumi.azurenative.storage.StorageAccount;
import com.pulumi.azurenative.storage.StorageAccountArgs;
import com.pulumi.azurenative.storage.enums.Bypass;
import com.pulumi.azurenative.storage.enums.DefaultAction;
import com.pulumi.azurenative.storage.enums.Kind;
import com.pulumi.azurenative.storage.enums.SkuName;
import com.pulumi.azurenative.storage.inputs.NetworkRuleSetArgs;
import com.pulumi.azurenative.storage.inputs.SkuArgs;
import com.pulumi.azurenative.storage.inputs.VirtualNetworkRuleArgs;
public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var resourceGroup = new ResourceGroup("resourceGroup");
var storageAccount = new StorageAccount("sa", StorageAccountArgs.builder()
.accountName("sto4445")
.enableHttpsTrafficOnly(false)
.enableNfsV3(true)
.isHnsEnabled(true)
.kind(Kind.BlockBlobStorage)
.location("eastus")
.networkRuleSet(NetworkRuleSetArgs.builder()
.bypass(Bypass.AzureServices)
.defaultAction(DefaultAction.Allow)
.ipRules()
.virtualNetworkRules(VirtualNetworkRuleArgs.builder()
.virtualNetworkResourceId("/subscriptions/{subscription-id}/resourceGroups/res9101/providers/Microsoft.Network/virtualNetworks/net123/subnets/subnet12")
.build())
.build())
.resourceGroupName(resourceGroup.name())
.sku(SkuArgs.builder()
.name(SkuName.Standard_LRS)
.build())
.build());
ctx.export("storage", storageAccount.id());
});
}
} I will move this issue to pulumi-java where the codegen is implemented. We will follow up on this from there. Hope this helps! |
Hi @Zaid-Ajaj thank you for your answer! I will test it again. Thank you for your help! |
@marctree We no longer generate |
Discussed in pulumi/pulumi#12469
Originally posted by marctree March 22, 2023
Hi folks,
i tried to create a infrastructure in azure cloud with pulumi java. Unfortunately i came across some wierd errors when i try to deploy a e.g. storage account or a key vault which are using "import java.util.Map;". I get always a compile error ->
Method com.pulumi.azurenative.storage.StorageAccountArgs.Builder.encryption(com.pulumi.core.Output<com.pulumi.azurenative.storage.inputs.EncryptionArgs>) is not applicable
(No matching arguments, No instances of type variables K,V,K,V,K,V,K,V,K,V,V,K,V,V,K,V,K,V,V,K,V,V,K,V,V,V,V,K,V, so java.util.Map<K,V> matches com.pulumi.core.Output<com.pulumi.azurenative.storage.inputs.EncryptionArgs>.
The example im using is this one here (StorageAccountCreate)-> https://www.pulumi.com/registry/packages/azure-native/api-docs/storage/storageaccount/
I init my pulumi project with the standard values so i dont have to change anything in the code. Still i got this error as long as the Map is in the code. When i delete the Map it works fine. Do i miss something here?
Thank you for your answers!
cheers
The text was updated successfully, but these errors were encountered: