Hello guys, i am working with pulumi using JavaScr...
# general
s
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.
f
I suggest using
awsx.cloudwatch.Dashboard
. It accepts Outputs in its args.
s
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" }); }) }