pulumi / pulumi-java

Java support for Pulumi
Apache License 2.0
64 stars 19 forks source link

AWS IOT PANIC rendering into docs #1350

Closed t0yv0 closed 2 months ago

t0yv0 commented 2 months ago

What happened?

Another example of AWS rendering PANIC into docs.

Example

data "aws_iot_endpoint" "example" {}

resource "kubernetes_pod" "agent" {
  metadata {
    name = "my-device"
  }

  spec {
    container {
      image = "gcr.io/my-project/image-name"
      name  = "image-name"

      env {
        name  = "IOT_ENDPOINT"
        value = data.aws_iot_endpoint.example.endpoint_address
      }
    }
  }
}

Rendering as

package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.iot.IotFunctions;
import com.pulumi.aws.iot.inputs.GetEndpointArgs;
import com.pulumi.kubernetes.core_v1.Pod;
import com.pulumi.kubernetes.core_v1.PodArgs;
import com.pulumi.kubernetes.meta_v1.inputs.ObjectMetaArgs;
import com.pulumi.kubernetes.core_v1.inputs.PodSpecArgs;
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) {
        final var example = IotFunctions.getEndpoint();

        var agent = new Pod("agent", PodArgs.builder()        
            .metadata(ObjectMetaArgs.builder()
                .name("my-device")
                .build())
            .spec(PodSpecArgs.builder()
                .container(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
                .build())
            .build());

    }
}

Output of pulumi about

N/A

Additional context

N/A

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).