{
  "description": "Rule is the Schema for the Rules API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "RuleSpec defines the desired state of Rule. \n Contains information about a rule in Amazon EventBridge.",
      "properties": {
        "description": {
          "description": "A description of the rule.",
          "type": "string"
        },
        "eventBusName": {
          "description": "The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.",
          "type": "string"
        },
        "eventBusRef": {
          "description": "AWSResourceReferenceWrapper provides a wrapper around *AWSResourceReference type to provide more user friendly syntax for references using 'from' field Ex: APIIDRef: \n from: name: my-api",
          "properties": {
            "from": {
              "description": "AWSResourceReference provides all the values necessary to reference another k8s resource for finding the identifier(Id/ARN/Name)",
              "properties": {
                "name": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "eventPattern": {
          "description": "The event pattern. For more information, see EventBridge event patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html.html) in the Amazon EventBridge User Guide.",
          "type": "string"
        },
        "name": {
          "description": "The name of the rule that you are creating or updating.",
          "type": "string"
        },
        "roleARN": {
          "description": "The Amazon Resource Name (ARN) of the IAM role associated with the rule. \n If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a RoleArn with proper permissions in the Target structure, instead of here in this parameter.",
          "type": "string"
        },
        "scheduleExpression": {
          "description": "The scheduling expression. For example, \"cron(0 20 * * ? *)\" or \"rate(5 minutes)\".",
          "type": "string"
        },
        "state": {
          "description": "Indicates whether the rule is enabled or disabled.",
          "type": "string"
        },
        "tags": {
          "description": "The list of key-value pairs to associate with the rule.",
          "items": {
            "description": "A key-value pair associated with an Amazon Web Services resource. In EventBridge, rules and event buses support tagging.",
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "targets": {
          "items": {
            "description": "Targets are the resources to be invoked when a rule is triggered. For a complete list of services and resources that can be set as a target, see PutTargets (https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_PutTargets.html). \n If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a RoleArn with proper permissions in the Target structure. For more information, see Sending and Receiving Events Between Amazon Web Services Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) in the Amazon EventBridge User Guide.",
            "properties": {
              "arn": {
                "type": "string"
              },
              "batchParameters": {
                "description": "The custom parameters to be used when the target is an Batch job.",
                "properties": {
                  "arrayProperties": {
                    "description": "The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. This parameter is used only if the target is an Batch job.",
                    "properties": {
                      "size": {
                        "format": "int64",
                        "type": "integer"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "jobDefinition": {
                    "type": "string"
                  },
                  "jobName": {
                    "type": "string"
                  },
                  "retryStrategy": {
                    "description": "The retry strategy to use for failed jobs, if the target is an Batch job. If you specify a retry strategy here, it overrides the retry strategy defined in the job definition.",
                    "properties": {
                      "attempts": {
                        "format": "int64",
                        "type": "integer"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "deadLetterConfig": {
                "description": "A DeadLetterConfig object that contains information about a dead-letter queue configuration.",
                "properties": {
                  "arn": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "ecsParameters": {
                "description": "The custom parameters to be used when the target is an Amazon ECS task.",
                "properties": {
                  "capacityProviderStrategy": {
                    "items": {
                      "description": "The details of a capacity provider strategy. To learn more, see CapacityProviderStrategyItem (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CapacityProviderStrategyItem.html) in the Amazon ECS API Reference.",
                      "properties": {
                        "base": {
                          "format": "int64",
                          "type": "integer"
                        },
                        "capacityProvider": {
                          "type": "string"
                        },
                        "weight": {
                          "format": "int64",
                          "type": "integer"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array"
                  },
                  "enableECSManagedTags": {
                    "type": "boolean"
                  },
                  "enableExecuteCommand": {
                    "type": "boolean"
                  },
                  "group": {
                    "type": "string"
                  },
                  "launchType": {
                    "type": "string"
                  },
                  "networkConfiguration": {
                    "description": "This structure specifies the network configuration for an ECS task.",
                    "properties": {
                      "awsVPCConfiguration": {
                        "description": "This structure specifies the VPC subnets and security groups for the task, and whether a public IP address is to be used. This structure is relevant only for ECS tasks that use the awsvpc network mode.",
                        "properties": {
                          "assignPublicIP": {
                            "type": "string"
                          },
                          "securityGroups": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "subnets": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "placementConstraints": {
                    "items": {
                      "description": "An object representing a constraint on task placement. To learn more, see Task Placement Constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the Amazon Elastic Container Service Developer Guide.",
                      "properties": {
                        "expression": {
                          "type": "string"
                        },
                        "type_": {
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array"
                  },
                  "placementStrategy": {
                    "items": {
                      "description": "The task placement strategy for a task or service. To learn more, see Task Placement Strategies (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html) in the Amazon Elastic Container Service Service Developer Guide.",
                      "properties": {
                        "field": {
                          "type": "string"
                        },
                        "type_": {
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array"
                  },
                  "platformVersion": {
                    "type": "string"
                  },
                  "propagateTags": {
                    "type": "string"
                  },
                  "referenceID": {
                    "type": "string"
                  },
                  "tags": {
                    "items": {
                      "description": "A key-value pair associated with an Amazon Web Services resource. In EventBridge, rules and event buses support tagging.",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array"
                  },
                  "taskCount": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "taskDefinitionARN": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "httpParameters": {
                "description": "These are custom parameter to be used when the target is an API Gateway REST APIs or EventBridge ApiDestinations. In the latter case, these are merged with any InvocationParameters specified on the Connection, with any values from the Connection taking precedence.",
                "properties": {
                  "headerParameters": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "pathParameterValues": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "queryStringParameters": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "id": {
                "type": "string"
              },
              "input": {
                "type": "string"
              },
              "inputPath": {
                "type": "string"
              },
              "inputTransformer": {
                "description": "Contains the parameters needed for you to provide custom input to a target based on one or more pieces of data extracted from the event.",
                "properties": {
                  "inputPathsMap": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "inputTemplate": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "kinesisParameters": {
                "description": "This object enables you to specify a JSON path to extract from the event and use as the partition key for the Amazon Kinesis data stream, so that you can control the shard to which the event goes. If you do not include this parameter, the default is to use the eventId as the partition key.",
                "properties": {
                  "partitionKeyPath": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "redshiftDataParameters": {
                "description": "These are custom parameters to be used when the target is a Amazon Redshift cluster to invoke the Amazon Redshift Data API ExecuteStatement based on EventBridge events.",
                "properties": {
                  "database": {
                    "type": "string"
                  },
                  "dbUser": {
                    "type": "string"
                  },
                  "secretManagerARN": {
                    "type": "string"
                  },
                  "sql": {
                    "type": "string"
                  },
                  "statementName": {
                    "type": "string"
                  },
                  "withEvent": {
                    "type": "boolean"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "retryPolicy": {
                "description": "A RetryPolicy object that includes information about the retry policy settings.",
                "properties": {
                  "maximumEventAgeInSeconds": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "maximumRetryAttempts": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "roleARN": {
                "type": "string"
              },
              "runCommandParameters": {
                "description": "This parameter contains the criteria (either InstanceIds or a tag) used to specify which EC2 instances are to be sent the command.",
                "properties": {
                  "runCommandTargets": {
                    "items": {
                      "description": "Information about the EC2 instances that are to be sent the command, specified as key-value pairs. Each RunCommandTarget block can include only one key, but this key may specify multiple values.",
                      "properties": {
                        "key": {
                          "type": "string"
                        },
                        "values": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "sageMakerPipelineParameters": {
                "description": "These are custom parameters to use when the target is a SageMaker Model Building Pipeline that starts based on EventBridge events.",
                "properties": {
                  "pipelineParameterList": {
                    "items": {
                      "description": "Name/Value pair of a parameter to start execution of a SageMaker Model Building Pipeline.",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "sqsParameters": {
                "description": "This structure includes the custom parameter to be used when the target is an SQS FIFO queue.",
                "properties": {
                  "messageGroupID": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "required": [
        "name"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "RuleStatus defines the observed state of Rule",
      "properties": {
        "ackResourceMetadata": {
          "description": "All CRs managed by ACK have a common `Status.ACKResourceMetadata` member that is used to contain resource sync state, account ownership, constructed ARN for the resource",
          "properties": {
            "arn": {
              "description": "ARN is the Amazon Resource Name for the resource. This is a globally-unique identifier and is set only by the ACK service controller once the controller has orchestrated the creation of the resource OR when it has verified that an \"adopted\" resource (a resource where the ARN annotation was set by the Kubernetes user on the CR) exists and matches the supplied CR's Spec field values. TODO(vijat@): Find a better strategy for resources that do not have ARN in CreateOutputResponse https://github.com/aws/aws-controllers-k8s/issues/270",
              "type": "string"
            },
            "ownerAccountID": {
              "description": "OwnerAccountID is the AWS Account ID of the account that owns the backend AWS service API resource.",
              "type": "string"
            },
            "region": {
              "description": "Region is the AWS region in which the resource exists or will exist.",
              "type": "string"
            }
          },
          "required": [
            "ownerAccountID",
            "region"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "conditions": {
          "description": "All CRS managed by ACK have a common `Status.Conditions` member that contains a collection of `ackv1alpha1.Condition` objects that describe the various terminal states of the CR and its backend AWS service API resource",
          "items": {
            "description": "Condition is the common struct used by all CRDs managed by ACK service controllers to indicate terminal states  of the CR and its backend AWS service API resource",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "A human readable message indicating details about the transition.",
                "type": "string"
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the Condition",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
