Hello guys, i am working with pulumi using JavaScr...
# general
Hello guys, i am working with pulumi using JavaScript and AWS, i want to create a CloudWatch Dashboard and i need to specify a dashboarbody that is a JSON, i want to create a dashboard to monitoring the CPU of my auto scaling group, and i must to specify the name of auto scaling but when i get the name of the ASG already created pulumi return me a promise.
I suggest using
. It accepts Outputs in its args.
Hello again, i solved my trouble, i used the Pulumi Apply but into the function, i created the aws resource and used stringify, share my code
function CreateDashboard(ParametersDashboard) { ParametersDashboard.ASG_Name.apply(name => { const body = { widgets: [ { type: "metric", x: 0, y: 0, width: 12, height: 6, properties: { metrics: [ [ "AWS/EC2", "CPUUtilization", "AutoScalingGroupName", name ] ], period: 300, stat: "Average", region: "us-east-1", title: "CPU-Utilization-Auto-Scaling" } } ] } const main = new aws.cloudwatch.Dashboard("main", { dashboardBody: JSON.stringify(body), dashboardName: "Dashboard" }); }) }