https://pulumi.com logo
#azure
Title
# azure
c

chilly-plastic-75584

03/29/2022, 1:31 AM
Trying to work through database accounts creation with pulumi and running into one resource that just won't cooperate. Getting this from my linter:
Copy code
cannot use bp (variable of type *documentdb.PeriodicModeBackupPolicy) as pulumi.Input value in struct literal: missing method ElementTypecompilerInvalidIfaceAssign
Trying to do:
Copy code
dbacct, err := documentdb.NewDatabaseAccount(ctx, "databaseAccount"+environment, &documentdb.DatabaseAccountArgs{
			AccountName: pulumi.String(cfgDatabaseAcct.Name),
			ApiProperties: &documentdb.ApiPropertiesArgs{
				ServerVersion: pulumi.String(cfgDatabaseAcct.ServerVersion),
			},
			BackupPolicy: bp,
}
I defined bp
Copy code
bp := &documentdb.PeriodicModeBackupPolicy{
			PeriodicModeProperties: &documentdb.PeriodicModeProperties{
				BackupIntervalInMinutes:        &cfgDatabaseAcct.BackupIntervalInMinutes,
				BackupRetentionIntervalInHours: &cfgDatabaseAcct.BackupRetentionIntervalInHours,
			},
			Type: cfgDatabaseAcct.BackupType,
		}
I adjusted PeriodicModeProperties to be a pointer based on object definition (the autogenerated example seems wrong?). Any ideas?
3 Views