• p

    powerful-art-87860

    2 months ago
    I've been having some issues with the
    propagateTags
    property from the aws.ecs.Service:1. setting it's value for the first time triggers a Service create-replacement. 2. changing it afterwards also triggers a Service create-replacement. The pulumi up detail shows the
    name
    ,
    id
    and
    propagateTags
    changing. The
    name
    and
    id
    change is due to the ending randomId from pulumi changing. Tried TASK_DEFINITION, SERVICE, NONE and removing the property, it always requires a replacement. I understand that changing the name triggers a replacement but why does
    propagateTags
    change the ending randomId from
    name
    ? Has anyone had this issue?
    p
    w
    +1
    10 replies
    Copy to Clipboard
  • b

    brave-scientist-99340

    2 months ago
    Hey, I am having a problem that might be related to the autonaming logic in https://github.com/pulumi/pulumi-google-native/pull/551. Since v0.21.0 of
    @pulumi/google-native
    I am getting the following change on a non-modified artifactregistry/v1:Repository:
    ~ name: "projects/***/locations/us/repositories/my-repo-822c5d8" => "projects/***/locations/us/repositories/my-repo-5637933"
    (only the ID changes). When I apply it I get the following error:
    google-native:artifactregistry/v1:Repository (***):
        error: error sending request: googleapi: Error 400: Repository mode cannot be changed: "<https://artifactregistry.googleapis.com/v1/projects/***/locations/us/repositories/my-repo>" map[format:DOCKER name:projects/***/locations/us/repositories/my-repo-ee37a82]
    Now this does not make sense to me because according to the GCP docs this name should just be
    projects/***/locations/us/repositories/my-repo
    and not have any random ID suffix (also I am pretty sure its immutable). Seems like a bug to me but I just wanted to check in if I missed something?
    b
    p
    3 replies
    Copy to Clipboard
  • p

    polite-napkin-90098

    2 months ago
    I'm having some more Output fun. I've exported the publicSubnetIds from an EKS stack with a line like:
    export const publicSubnetIds = cluster.core.publicSubnetIds;
    and then import them into another stack with
    const pubsub = stackMon.getOutput("publicSubnetIds");
    I then need to use them to annotate an ingress in a helm chart something like
    ingress: {
        annotations: {
            '<http://alb.ingress.kubernetes.io/subnets|alb.ingress.kubernetes.io/subnets>': `${pubsub[0]}, ${pubsub[1]}`
    or
    '<http://alb.ingress.kubernetes.io/subnets|alb.ingress.kubernetes.io/subnets>': `${pubsub.join(',')}`
    but this results in
    Property 'join' does not exist on type 'OutputInstance<any>'.
    or a similar error saying I can't index an Output<any> with 0 or 1 What am I getting wrong here? Can I not export an array? Do I need some apply magic on the gotten output before Typescript will accept it is and array and can be joined?
    p
    r
    7 replies
    Copy to Clipboard
  • s

    square-ability-48831

    2 months ago
    I'm trying to override the autonaming of an ECR repository, but not sure if this is a type issue or an api issue -
    // Create a repository.
    const repo = new awsx.ecr.Repository("cicd", {
      name: "cicd",
    });
    the docs show a name param is available to be set, but I get:
    index.ts(5,3): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type 'RepositoryArgs'.
          Object literal may only specify known properties, and 'name' does not exist in type 'RepositoryArgs'.
    s
    b
    5 replies
    Copy to Clipboard
  • b

    big-notebook-65054

    2 months ago
    Hi, I'm having some trouble getting a random password into a string I can use within the code. It says to use
    password.result
    but that doesn't seem to ever change from a
    pulumi.Output<string>
    type.
    const password = new random.RandomPassword(`random-password-${stack}`, { length: 16 });
    To get into the specifics more, I am trying to place this password output into a config file on an EC2 instance by inserting it into the userData script. Every time I check the new EC2 server I get this error in the logs:
    To get the value of an Output<T> as an Output<string> consider either:
    1: o.apply(v => `prefix${v}suffix`)
    2: pulumi.interpolate `prefix${v}suffix`
    See <https://pulumi.io/help/outputs> for more details.
    This function may throw in a future version of @pulumi/pulumi./"
    In the docs it says
    Because outputs are asynchronous, their actual raw values are not immediately available.
    which makes sense, but I cannot use
    apply()
    or any of the other options to get a readable string value on the
    password.result
    output. What am I missing here? Is there some sort of async/await functionality I can use to wait for it to resolve? Thanks!
    b
    b
    5 replies
    Copy to Clipboard
  • s

    strong-megabyte-18664

    2 months ago
    Hello, I’m just getting started with Pulumi and I’m already stuck.
    import * as awsClassic from "@pulumi/aws";
    
    const vpc = awsClassic.ec2.getVpcs({
        tags: {
            env: "staging"
        }
    });
    
    // Export a few interesting fields to make them easy to use:
    export const vpcId = vpc.??
    I get any properties on the
    vpc
    const. I think it’s because
    ec2.getVpcs()
    is returning a
    Promise<GetVpcsResult>
    . I have zero Typescript experience and I’m not sure how to handle the Promise return so I can retrieve Vpc properties from it. Maybe an
    await
    or something? Help!
    s
    b
    3 replies
    Copy to Clipboard
  • a

    able-hair-32695

    2 months ago
    What’s the correct way to define a custom role for a serialized function tied to an EventRule for example? So far, I see that the
    aws.cloudwatch.onSchedule
    handler argument which is an
    EventRuleEventHandler
    has the below doc on it referencing a
    createCallbackFunction
    but I can’t find any docs referencing that anywhere(Other than in the
    pulumi-cloud
    repo). As it stands now it seems like the inline function definitions always default to
    iam.AWSLambda_FullAccess
    . I’m hoping to be able to define my own role for the functionhttps://github.com/pulumi/pulumi-aws/blob/914003a7a1d16b8389529420a2a91200bc250d7e/sdk/nodejs/lambda/lambdaMixins.ts#L141-L148 Pulumi Doc I based my code on: https://www.pulumi.com/blog/scheduling-serverless/
  • b

    big-notebook-65054

    1 month ago
    I have two
    command.remote.Command
    issues/questions that I would love some insight on if possible:1. The first command I try to run on the server is a combination
    sudo apt-get update && sudo apt-get install redis-server -y
    . The weird part is that it works maybe 50-60% of the time but when it fails it gives me an error message which indicates that
    apt-get update
    didnt run:
    E: Unable to locate package redis-server error: Process exited with status 100
    2. Later on in the list of commands I try to set the redis password via the redis-cli interactive shell with this command:
    sudo redis-cli <<<"CONFIG SET requirepass ${result.secretString}"
    . stdout returns and
    OK
    which typically indicates success when done manually, however when I try to log into the server remotely there is no password set. Very strange behavior.
    b
    a
    3 replies
    Copy to Clipboard
  • b

    brief-helicopter-28120

    1 month ago
    Hello, I'm trying to use
    k8s.yaml.ConfigFile
    to deploy CRDs into my EKS cluster (typescript) and I run into issues. Btw I'm new to typescript and as well to pulumi. So please kindly bare with me 🙏 Code:
    import * as k8s from "@pulumi/kubernetes";
    import * as eks from "@pulumi/eks";
    
    
    export default {
        install_crds(cluster: eks.Cluster){
            new k8s.yaml.ConfigFile("argocd_namespace", {
                file: "kubernetes_cluster_components/namespaces/argocd-namespace.yaml",
            }, {providers: { "kubernetes": cluster.provider }});
        }
    };
    Error:
    pulumi:pulumi:Stack  k8s-moralis-aws-dev-argo-test  running.    error: an unhandled error occurred: Program exited with non-zero exit code: -1
    I0804 09:23:53.878138   22054 deployment_executor.go:162] deploymentExecutor.Execute(...): exiting provider canceller
         Type                 Name                           Plan     Info
         pulumi:pulumi:Stack  k8s-moralis-aws-dev-argo-test           1 error; 39 messages
    
    Diagnostics:
      pulumi:pulumi:Stack (k8s-moralis-aws-dev-argo-test):
        Cloud Provider: aws Stack: aws-dev-argo-test
    
        error: an unhandled error occurred: Program exited with non-zero exit code: -1
    The error message is not very descriptive, hence difficult to troubleshoot. Can someone please help me here 🙏
    b
    2 replies
    Copy to Clipboard
  • w

    white-chef-55657

    1 month ago
    I couldn’t find in the docs of the pulumi package, but is there a way to check if I’m currently in preview/update/destroy etc. ?
    w
    w
    8 replies
    Copy to Clipboard