Get last matched lines

i have a file called ssl.crt

cat ssl.crt

-----BEGIN CERTIFICATE-----
dfhdfd
jdfhdjkfh
dfdfdjfdf
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
eryeurer
dhfdfdf
fjdjfh
rery
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
rutyr
fgjhu
rutr
-----END CERTIFICATE-----

I want to take only last

-----BEGIN CERTIFICATE-----
rutyr
fgjhu
rutr
-----END CERTIFICATE-----

is there an option in terraform?

trying something like this:

resource "aws_acm_certificate" "cert2" {
  private_key      = file("./cert.key")
  certificate_body = file("./cert.crt")
  certificate_chain = file("./cert.crt")
}

unfortunately, my certificate_body and certificate_chain both are in a single file (ssl.crt)

from ssl.crt I want to take last matched set (this is cert_body)

-----BEGIN CERTIFICATE-----
rutyr
fgjhu
rutr
-----END CERTIFICATE-----