CreateApp

enum_ServerType := [ "VIRTUAL_MACHINE" ]
enum_VmManagerType := [ "VSPHERE", "SCVMM", "HYPERV-MANAGER" ]

valid {
    input.Body.name == STRING
    input.Body.description == STRING
    input.Body.roleName == STRING
    input.Body.clientToken == STRING
    input.Body.serverGroups[_].serverGroupId == STRING
    input.Body.serverGroups[_].name == STRING
    input.Body.serverGroups[_].serverList[_].serverId == STRING
    input.Body.serverGroups[_].serverList[_].serverType == enum_ServerType[_]
    input.Body.serverGroups[_].serverList[_].vmServer.vmServerAddress.vmManagerId == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmServerAddress.vmId == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmName == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmManagerName == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmManagerType == enum_VmManagerType[_]
    input.Body.serverGroups[_].serverList[_].vmServer.vmPath == STRING
    input.Body.serverGroups[_].serverList[_].replicationJobId == STRING
    input.Body.serverGroups[_].serverList[_].replicationJobTerminated == BOOLEAN
    input.Body.tags[_].key == STRING
    input.Body.tags[_].value == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

CreateReplicationJob

enum_LicenseType := [ "AWS", "BYOL" ]

valid {
    input.Body.serverId == STRING
    input.Body.seedReplicationTime == TIMESTAMP
    input.Body.frequency == INTEGER
    input.Body.runOnce == BOOLEAN
    input.Body.licenseType == enum_LicenseType[_]
    input.Body.roleName == STRING
    input.Body.description == STRING
    input.Body.numberOfRecentAmisToKeep == INTEGER
    input.Body.encrypted == BOOLEAN
    input.Body.kmsKeyId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteApp

valid {
    input.Body.appId == STRING
    input.Body.forceStopAppReplication == BOOLEAN
    input.Body.forceTerminateApp == BOOLEAN
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteAppLaunchConfiguration

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteAppReplicationConfiguration

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteAppValidationConfiguration

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteReplicationJob

valid {
    input.Body.replicationJobId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DeleteServerCatalog

valid {
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

DisassociateConnector

valid {
    input.Body.connectorId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GenerateChangeSet

enum_OutputFormat := [ "JSON", "YAML" ]

valid {
    input.Body.appId == STRING
    input.Body.changesetFormat == enum_OutputFormat[_]
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GenerateTemplate

enum_OutputFormat := [ "JSON", "YAML" ]

valid {
    input.Body.appId == STRING
    input.Body.templateFormat == enum_OutputFormat[_]
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetApp

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetAppLaunchConfiguration

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetAppReplicationConfiguration

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetAppValidationConfiguration

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetAppValidationOutput

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetConnectors

valid {
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetReplicationJobs

valid {
    input.Body.replicationJobId == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetReplicationRuns

valid {
    input.Body.replicationJobId == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

GetServers

valid {
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.Body.vmServerAddressList[_].vmManagerId == STRING
    input.Body.vmServerAddressList[_].vmId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ImportAppCatalog

valid {
    input.Body.roleName == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ImportServerCatalog

valid {
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

LaunchApp

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

ListApps

valid {
    input.Body.appIds[_] == STRING
    input.Body.nextToken == STRING
    input.Body.maxResults == INTEGER
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

NotifyAppValidationOutput

enum_ValidationStatus := [ "READY_FOR_VALIDATION", "PENDING", "IN_PROGRESS", "SUCCEEDED", "FAILED" ]

valid {
    input.Body.appId == STRING
    input.Body.notificationContext.validationId == STRING
    input.Body.notificationContext.status == enum_ValidationStatus[_]
    input.Body.notificationContext.statusMessage == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

PutAppLaunchConfiguration

enum_ScriptType := [ "SHELL_SCRIPT", "POWERSHELL_SCRIPT" ]
enum_ServerType := [ "VIRTUAL_MACHINE" ]
enum_VmManagerType := [ "VSPHERE", "SCVMM", "HYPERV-MANAGER" ]

valid {
    input.Body.appId == STRING
    input.Body.roleName == STRING
    input.Body.autoLaunch == BOOLEAN
    input.Body.serverGroupLaunchConfigurations[_].serverGroupId == STRING
    input.Body.serverGroupLaunchConfigurations[_].launchOrder == INTEGER
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.serverId == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.serverType == enum_ServerType[_]
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.vmServer.vmServerAddress.vmManagerId == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.vmServer.vmServerAddress.vmId == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.vmServer.vmName == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.vmServer.vmManagerName == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.vmServer.vmManagerType == enum_VmManagerType[_]
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.vmServer.vmPath == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.replicationJobId == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].server.replicationJobTerminated == BOOLEAN
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].logicalId == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].vpc == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].subnet == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].securityGroup == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].ec2KeyName == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].userData.s3Location.bucket == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].userData.s3Location.key == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].instanceType == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].associatePublicIpAddress == BOOLEAN
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].iamInstanceProfileName == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].configureScript.bucket == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].configureScript.key == STRING
    input.Body.serverGroupLaunchConfigurations[_].serverLaunchConfigurations[_].configureScriptType == enum_ScriptType[_]
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

PutAppReplicationConfiguration

enum_LicenseType := [ "AWS", "BYOL" ]
enum_ServerType := [ "VIRTUAL_MACHINE" ]
enum_VmManagerType := [ "VSPHERE", "SCVMM", "HYPERV-MANAGER" ]

valid {
    input.Body.appId == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverGroupId == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.serverId == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.serverType == enum_ServerType[_]
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.vmServer.vmServerAddress.vmManagerId == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.vmServer.vmServerAddress.vmId == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.vmServer.vmName == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.vmServer.vmManagerName == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.vmServer.vmManagerType == enum_VmManagerType[_]
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.vmServer.vmPath == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.replicationJobId == STRING
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].server.replicationJobTerminated == BOOLEAN
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.seedTime == TIMESTAMP
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.frequency == INTEGER
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.runOnce == BOOLEAN
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.licenseType == enum_LicenseType[_]
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.numberOfRecentAmisToKeep == INTEGER
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.encrypted == BOOLEAN
    input.Body.serverGroupReplicationConfigurations[_].serverReplicationConfigurations[_].serverReplicationParameters.kmsKeyId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

PutAppValidationConfiguration

enum_AppValidationStrategy := [ "SSM" ]
enum_ScriptType := [ "SHELL_SCRIPT", "POWERSHELL_SCRIPT" ]
enum_ServerType := [ "VIRTUAL_MACHINE" ]
enum_ServerValidationStrategy := [ "USERDATA" ]
enum_VmManagerType := [ "VSPHERE", "SCVMM", "HYPERV-MANAGER" ]

valid {
    input.Body.appId == STRING
    input.Body.appValidationConfigurations[_].validationId == STRING
    input.Body.appValidationConfigurations[_].name == STRING
    input.Body.appValidationConfigurations[_].appValidationStrategy == enum_AppValidationStrategy[_]
    input.Body.appValidationConfigurations[_].ssmValidationParameters.source.s3Location.bucket == STRING
    input.Body.appValidationConfigurations[_].ssmValidationParameters.source.s3Location.key == STRING
    input.Body.appValidationConfigurations[_].ssmValidationParameters.instanceId == STRING
    input.Body.appValidationConfigurations[_].ssmValidationParameters.scriptType == enum_ScriptType[_]
    input.Body.appValidationConfigurations[_].ssmValidationParameters.command == STRING
    input.Body.appValidationConfigurations[_].ssmValidationParameters.executionTimeoutSeconds == INTEGER
    input.Body.appValidationConfigurations[_].ssmValidationParameters.outputS3BucketName == STRING
    input.Body.serverGroupValidationConfigurations[_].serverGroupId == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.serverId == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.serverType == enum_ServerType[_]
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.vmServer.vmServerAddress.vmManagerId == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.vmServer.vmServerAddress.vmId == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.vmServer.vmName == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.vmServer.vmManagerName == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.vmServer.vmManagerType == enum_VmManagerType[_]
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.vmServer.vmPath == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.replicationJobId == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].server.replicationJobTerminated == BOOLEAN
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].validationId == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].name == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].serverValidationStrategy == enum_ServerValidationStrategy[_]
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].userDataValidationParameters.source.s3Location.bucket == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].userDataValidationParameters.source.s3Location.key == STRING
    input.Body.serverGroupValidationConfigurations[_].serverValidationConfigurations[_].userDataValidationParameters.scriptType == enum_ScriptType[_]
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

StartAppReplication

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

StartOnDemandAppReplication

valid {
    input.Body.appId == STRING
    input.Body.description == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

StartOnDemandReplicationRun

valid {
    input.Body.replicationJobId == STRING
    input.Body.description == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

StopAppReplication

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

TerminateApp

valid {
    input.Body.appId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

UpdateApp

enum_ServerType := [ "VIRTUAL_MACHINE" ]
enum_VmManagerType := [ "VSPHERE", "SCVMM", "HYPERV-MANAGER" ]

valid {
    input.Body.appId == STRING
    input.Body.name == STRING
    input.Body.description == STRING
    input.Body.roleName == STRING
    input.Body.serverGroups[_].serverGroupId == STRING
    input.Body.serverGroups[_].name == STRING
    input.Body.serverGroups[_].serverList[_].serverId == STRING
    input.Body.serverGroups[_].serverList[_].serverType == enum_ServerType[_]
    input.Body.serverGroups[_].serverList[_].vmServer.vmServerAddress.vmManagerId == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmServerAddress.vmId == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmName == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmManagerName == STRING
    input.Body.serverGroups[_].serverList[_].vmServer.vmManagerType == enum_VmManagerType[_]
    input.Body.serverGroups[_].serverList[_].vmServer.vmPath == STRING
    input.Body.serverGroups[_].serverList[_].replicationJobId == STRING
    input.Body.serverGroups[_].serverList[_].replicationJobTerminated == BOOLEAN
    input.Body.tags[_].key == STRING
    input.Body.tags[_].value == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}

UpdateReplicationJob

enum_LicenseType := [ "AWS", "BYOL" ]

valid {
    input.Body.replicationJobId == STRING
    input.Body.frequency == INTEGER
    input.Body.nextReplicationRunStartTime == TIMESTAMP
    input.Body.licenseType == enum_LicenseType[_]
    input.Body.roleName == STRING
    input.Body.description == STRING
    input.Body.numberOfRecentAmisToKeep == INTEGER
    input.Body.encrypted == BOOLEAN
    input.Body.kmsKeyId == STRING
    input.ProviderMetadata.Account == STRING
    input.ProviderMetadata.AccessKeyId == STRING
    input.ProviderMetadata.Region == STRING
}