m

    microscopic-doctor-76377

    1 month ago
    hi How to start stop a ec2 instance using pulumi automation api?
    e

    echoing-dinner-19531

    1 month ago
    We don't expose the entire set of operations possible via the aws api in Pulumi. For things like this we'd recommend just using the aws sdk for your language to send the stop/start commands.
    m

    microscopic-doctor-76377

    1 month ago
    Ok So can i update the state file of instance status after making stop or start through aws sdk??? Also is it mandatory to update ? Before doing any another operation (like adding volume)once the ec2 is created
    e

    echoing-dinner-19531

    1 month ago
    Yes, you can always use
    pulumi refresh
    to get pulumi to check the vm state and update its view of the instance. You probably want to add things like volumes as part of creating the instance in pulumi.
    m

    microscopic-doctor-76377

    1 month ago
    Can you help me on how to refresh the state file using the api and not using the pulumi cli
    e

    echoing-dinner-19531

    1 month ago
    There's a refresh method on the stack type. e.g. for TypeScript: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/automation/#Stack-refresh Just call that, instead of the up method.