Save 37% off PRO during our Black Friday Sale! »

AWSとGo言語とコンテナによる証券プラットフォーム

 AWSとGo言語とコンテナによる証券プラットフォーム

5a2478d5008e1c64bca72c650178341e?s=128

atsushi-ishibashi

March 20, 2019
Tweet

Transcript

  1. AWSͱGoݴޠͱίϯςφʹΑΔ ূ݊ϓϥοτϑΥʔϜ

  2. ࣗݾ঺հ - ੴڮ३ࢤ • ࡏֶதʹFinatextʹؔΘΔ • ೔ࠒ࢖͍ͬͯΔݴޠɿGoݴޠ • terraform-provider-awsʹͦͦ͜͜ߩݙ •

    झຯɿα΢φ • GitHubɿatsushi-ishibashi
  3. ձࣾ঺հ - Finatext

  4. . 5 ͜ͷ՝୊Λղܾ͢ΔͨΊզʑ͸4FSWJDFʗ#JHEBUBʗ 1MBUGPSNΛ։ൃ͠ࡾҐҰମͰۚ༥Λ4FSWJDFͱͯ͠࠶ൃ໌͢Δ ࿪Μͩ#VTJOFTTϞσϧ ϚΠφεͳސ٬ମݧ ۚ༥αʔϏε6* 69 #UP$#UP#UP$Ͱͷ ۚ༥ϑϩϯταʔϏε։ൃɻ

    ূ݊γεςϜ#BB4 ূ݊γεςϜΛ"1*αʔϏεԽ͠ɺ ূ݊ϏδωεϓϥοτϑΥʔϜΛఏڙ େखϔοδϑΝϯυ౳ػؔ౤ࢿՈ޲͚ʹσʔλαʔϏεΛఏڙɻ Ϗοάσʔλղੳ
  5.      .. αʔϏεఏڙऀଆͷূ݊αʔϏε্ཱͪ͛ʹ͔͔ΔίετΛ࡟ݮ ͠ɺੜ׆ऀʹΘ͔Γ΍͍͢ূ݊αʔϏεΛಧ͚Δ͜ͱ͕Մೳʹ

  6. ಛ௃ • ΄΅શͯͷαʔϏε͕ίϯςφՔಇ • ೝূαʔϏεͷ੾Γग़͠ • Direct ConnectͰͷ֎઀؀ڥ

  7. Route53 ALB αϒυϝΠϯͰ ECS CWL Host HeaderͰ ৼΓ෼͚ ϩάͷू໿ CWE

    cron࣮ߦ
  8. GoݴޠʹΑΔίϯςφӡ༻ • ECSʹΑΔΦʔτώʔϦϯά / ΫϥελͷASGʹΑΔߏ੒ →؆୯ʹ௵ͤΔ؀ڥ • awslogsʹΑͬͯඪ४ग़ྗͰCWLʹϩάΛू໿ →ϝτϦΫεϑΟϧλʔ΍KinesisͷLambdaͰΞϓϦέʔ γϣϯϩάʹΦϯϥΠϯϨεϙϯεɻexport

    taskͰS3ʹύʔ ςΟγϣϯ෼ׂͯ͠ు͖ग़͠ • cronॲཧΛCWEͰϚωʔδυ؅ཧ →CLIͰઃఆ͞ΕͯΔcron jobͷҰཡԽ͕༰қʂ • NO SSH • Goͩͱίϯςφখͯ͘͞Dockerfile΋΄΅ςϯϓϨԽ͢Δ
  9. ɾେମ্͕ͷΑ͏ͳDockerfileͰॻ͚Δ ɾΠϝʔδαΠζ΋10MB͘Β͍ FROM golang:alpine as builder ENV APPDIR $GOPATH/src/example RUN

    \ apk update && \ rm -rf /var/cache/apk/* && \ mkdir -p $APPDIR ADD . $APPDIR/ WORKDIR $APPDIR RUN go build -ldflags “-s -w” -o example FROM alpine RUN apk add —no-cache ca-certificates COPY —-from=builder /go/src/example/example /usr/local/bin/ ENTRYPOINT [“example”]
  10. ೝূαʔϏεͷ੾Γग़͠ Cognito ೝՄαʔϏε gRPC

  11. Direct ConnectͰͷ֎઀؀ڥ • ۚ༥ͩͱൃ஫΍ࢢ৔σʔλͷऔಘͳͲTCPʹͯಠࣗ࢓ ༷Ͱૄ௨͢Δ͜ͱΖ͕͋Δɻ →ઐ༻ઢͰͷ઀ଓ͕ඞཁɻDXͰAWS؀ڥʹܨ͗͜Μͩ • ϑΝΠϧ࿈ܞ͸SFTP͕Α͋͘Δ →AWS Transferॿ͔Δɻͨͩͪΐͬͱߴ͍…

    • S3ͰͷϑΝΠϧ࿈ܞ͕Մೳͳͱ͜Ζ΋ͪ´ • কདྷతʹ͸Private LinkͰܨ͍ͰDX֎ͤͨΒΑ͍ͳʔ →͍ΘΏΔAWS΍GCP͕Πϯλʔωοτʹͳͬͯ͘΍ͭ
  12. ·ͱΊ • ͱʹ͔͘ίϯςφΦʔέετϨʔγϣϯ ྑ͍Α • ೝূ / ೝՄ͸͓΋͠Ζ͍͕ɺαʔϏεཁ ݅ʹ߹Θͤͯબ୒͠Α͏ •

    AWS͕ΠϯλʔωοτʹͳΔͱྑ͍ͳ(?) • Finatext͸ۚ༥ʹڵຯ͋ΔΤϯδχΞΛ ืूͯ͠·͢ʂʂ