little-cartoon-10569
12/11/2020, 1:24 AMinput/backup/PlanRule[]
import {input} from "@pulumi/aws/types"
and then I can use input.backup.PlanRule
.aws.backup.PlanRule
, or...?cool-fireman-90027
12/11/2020, 2:00 PMimport * as aws from "@pulumi/aws";
const myplan = new aws.backup.Plan("shaht-backupplan", {
name: "shahtbackupplan",
rules: [{
ruleName: "tf_example_backup_rule",
targetVaultName: "Default",
schedule: "cron(0 12 * * ? *)",
}],
advancedBackupSettings: [{
backupOptions: {
WindowsVSS: "enabled",
},
resourceType: "EC2",
}],
});
export const backup_plan_name = myplan.name;
export const backup_plan_version = myplan.version;
export const backup_plan_rules = myplan.rules;
export const backup_plan_lifecycle = myplan.rules[0]["lifecycle"];
export const backup_plan_completionWindow = myplan.rules[0]["completionWindow"];
export const backup_plan_schedule = myplan.rules[0]["schedule"];
The last 3 lines seem like the what you want to get at
Here is my output of them:
backup_plan_completionWindow 180
backup_plan_lifecycle null
backup_plan_schedule cron(0 12 * * ? *)
little-cartoon-10569
12/13/2020, 8:27 PMconst rule: aws.backup.PlanRule = plan.rules[0];
aws.backup.PlanRule
, since that's where everything else is, but instead I'm having to use input.backup.PlanRule
. I just wanted to know if that's expected and I'm doing it correctly, or if there's a different (better) way to do it.