1 Answer
- Newest
- Most votes
- Most comments
0
Here’s an example of how you might create smaller segments programmatically to stay within limits:
import boto3
client = boto3.client('pinpoint')
def create_segment(segment_name, attribute_name, attribute_values):
# Split attribute values into chunks to stay within the limit
chunk_size = 1000 # Adjust based on your understanding of limits
chunks = [attribute_values[i:i + chunk_size] for i in range(0, len(attribute_values), chunk_size)]
for index, chunk in enumerate(chunks):
segment_response = client.create_segment(
ApplicationId='your-app-id',
WriteSegmentRequest={
'Name': f'{segment_name}_part_{index + 1}',
'Dimensions': {
'Attributes': {
attribute_name: {
'Values': chunk,
'AttributeType': 'INCLUSIVE'
}
}
}
}
)
print(f'Segment {segment_name}_part_{index + 1} created: {segment_response}')
# Example usage
create_segment('MySegment', 'CustomAttribute', ['value1', 'value2', ... up to 15000 values ...])
answered 2 years ago
what is the limit though it seems to possibly be adaptive! Is there documentation for this limit?

The Segment value count of 15000 is larger than the limit error in Amazon Pinpoint indicating that you are exceeding the allowed number of values for a segment attribute.