How to Use Input element inside an event bridge ? #4370
Labels
bug
This issue is a confirmed bug.
p2
This is a standard priority issue
response-requested
Waiting on additional information or feedback.
scheduler
service-api
This issue is caused by the service API, not the SDK implementation.
Describe the bug
Im starting a FARGATE application with eventbridge api boto3 python, and its working fine.
However ive setup a ENV VARIABLES in FARGATE cluster definition tasks, and it works fine if i run it manualy in create tasks dashboard.
When begin using The API i receive this error, even using a STRING o JSON Format, with INPUT parameter inside Target.EcsParameters
Erros:
Invalid type for parameter Target.Input, value: {'PartitionKey': 'string'}, type: <class 'dict'>, valid types: <class 'str'>
-Invalid type for parameter Target.Input, value: {'VAR1': 'string'}, type: <class 'dict'>, valid types: <class 'str'>
ERROR:root:An error occurred: An error occurred (ValidationException) when calling the CreateSchedule operation: Unable to convert target input to TaskOverride, JSON syntax error in input: [Source: (String)"{"VAR1": "string"}"; line: 1, column: 11]
`
response = client.create_schedule(
Name=f"NOME", # Nome do agendamento
Description='NOME',
ScheduleExpression='cron(55 16 8 * ? *)', # Exemplo: Executa todos os dias ao meio-dia UTC
ScheduleExpressionTimezone=self.timezone , # Fuso horário da expressão CRON
#TaskCount=1, # Número de tarefas a serem executadas
Target={
'Arn': 'x', # Substitua pelo ARN do destino
'RoleArn': 'x', # Substitua pelo ARN do papel com permissões
'EcsParameters': { # Configurações específicas para ECS
'TaskDefinitionArn': 'x', # Substitua pelo ARN da Task Definition
'LaunchType': 'FARGATE', # Tipo de execução (EC2 ou FARGATE)
'NetworkConfiguration': {
'awsvpcConfiguration': { # Configurações de rede para FARGATE
'Subnets': ['y'], # Substitua pelos IDs das sub-redes
#'SecurityGroups': ['1'], # Substitua pelo ID do Security Group
'AssignPublicIp': 'DISABLED' # Define se o IP público será atribuído
}
},
`
Regression Issue
Expected Behavior
Create a scheduled event on event bridge, with the parameters to apply when runs my container.
Current Behavior
I cant go on.
Reproduction Steps
Wen i try to run the code i has this error.
Possible Solution
No response
Additional Information/Context
No response
SDK version used
1.35.76
Environment details (OS name and version, etc.)
macos
The text was updated successfully, but these errors were encountered: