Struct aws_sdk_cloudfront::model::ViewerCertificate
source · #[non_exhaustive]pub struct ViewerCertificate { /* private fields */ }
Expand description
A complex type that determines the distribution’s SSL/TLS configuration for communicating with viewers.
If the distribution doesn’t use Aliases
(also known as alternate domain names or CNAMEs)—that is, if the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net
—set CloudFrontDefaultCertificate
to true
and leave all other fields empty.
If the distribution uses Aliases
(alternate domain names or CNAMEs), use the fields in this type to specify the following settings:
-
Which viewers the distribution accepts HTTPS connections from: only viewers that support server name indication (SNI) (recommended), or all viewers including those that don’t support SNI.
-
To accept HTTPS connections from only viewers that support SNI, set
SSLSupportMethod
tosni-only
. This is recommended. Most browsers and clients support SNI. -
To accept HTTPS connections from all viewers, including those that don’t support SNI, set
SSLSupportMethod
tovip
. This is not recommended, and results in additional monthly charges from CloudFront.
-
-
The minimum SSL/TLS protocol version that the distribution can use to communicate with viewers. To specify a minimum version, choose a value for
MinimumProtocolVersion
. For more information, see Security Policy in the Amazon CloudFront Developer Guide. -
The location of the SSL/TLS certificate, Certificate Manager (ACM) (recommended) or Identity and Access Management (IAM). You specify the location by setting a value in one of the following fields (not both):
-
ACMCertificateArn
-
IAMCertificateId
-
All distributions support HTTPS connections from viewers. To require viewers to use HTTPS only, or to redirect them from HTTP to HTTPS, use ViewerProtocolPolicy
in the CacheBehavior
or DefaultCacheBehavior
. To specify how CloudFront should use SSL/TLS to communicate with your custom origin, use CustomOriginConfig
.
For more information, see Using HTTPS with CloudFront and Using Alternate Domain Names and HTTPS in the Amazon CloudFront Developer Guide.
Implementations§
source§impl ViewerCertificate
impl ViewerCertificate
sourcepub fn cloud_front_default_certificate(&self) -> Option<bool>
pub fn cloud_front_default_certificate(&self) -> Option<bool>
If the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net
, set this field to true
.
If the distribution uses Aliases
(alternate domain names or CNAMEs), set this field to false
and specify values for the following fields:
-
ACMCertificateArn
orIAMCertificateId
(specify a value for one, not both) -
MinimumProtocolVersion
-
SSLSupportMethod
sourcepub fn iam_certificate_id(&self) -> Option<&str>
pub fn iam_certificate_id(&self) -> Option<&str>
If the distribution uses Aliases
(alternate domain names or CNAMEs) and the SSL/TLS certificate is stored in Identity and Access Management (IAM), provide the ID of the IAM certificate.
If you specify an IAM certificate ID, you must also specify values for MinimumProtocolVersion
and SSLSupportMethod
.
sourcepub fn acm_certificate_arn(&self) -> Option<&str>
pub fn acm_certificate_arn(&self) -> Option<&str>
If the distribution uses Aliases
(alternate domain names or CNAMEs) and the SSL/TLS certificate is stored in Certificate Manager (ACM), provide the Amazon Resource Name (ARN) of the ACM certificate. CloudFront only supports ACM certificates in the US East (N. Virginia) Region (us-east-1
).
If you specify an ACM certificate ARN, you must also specify values for MinimumProtocolVersion
and SSLSupportMethod
.
sourcepub fn ssl_support_method(&self) -> Option<&SslSupportMethod>
pub fn ssl_support_method(&self) -> Option<&SslSupportMethod>
If the distribution uses Aliases
(alternate domain names or CNAMEs), specify which viewers the distribution accepts HTTPS connections from.
-
sni-only
– The distribution accepts HTTPS connections from only viewers that support server name indication (SNI). This is recommended. Most browsers and clients support SNI. -
vip
– The distribution accepts HTTPS connections from all viewers including those that don’t support SNI. This is not recommended, and results in additional monthly charges from CloudFront. -
static-ip
- Do not specify this value unless your distribution has been enabled for this feature by the CloudFront team. If you have a use case that requires static IP addresses for a distribution, contact CloudFront through the Amazon Web Services Support Center.
If the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net
, don’t set a value for this field.
sourcepub fn minimum_protocol_version(&self) -> Option<&MinimumProtocolVersion>
pub fn minimum_protocol_version(&self) -> Option<&MinimumProtocolVersion>
If the distribution uses Aliases
(alternate domain names or CNAMEs), specify the security policy that you want CloudFront to use for HTTPS connections with viewers. The security policy determines two settings:
-
The minimum SSL/TLS protocol that CloudFront can use to communicate with viewers.
-
The ciphers that CloudFront can use to encrypt the content that it returns to viewers.
For more information, see Security Policy and Supported Protocols and Ciphers Between Viewers and CloudFront in the Amazon CloudFront Developer Guide.
On the CloudFront console, this setting is called Security Policy.
When you’re using SNI only (you set SSLSupportMethod
to sni-only
), you must specify TLSv1
or higher.
If the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net
(you set CloudFrontDefaultCertificate
to true
), CloudFront automatically sets the security policy to TLSv1
regardless of the value that you set here.
sourcepub fn certificate(&self) -> Option<&str>
👎Deprecated
pub fn certificate(&self) -> Option<&str>
This field is deprecated. Use one of the following fields instead:
-
ACMCertificateArn
-
IAMCertificateId
-
CloudFrontDefaultCertificate
sourcepub fn certificate_source(&self) -> Option<&CertificateSource>
👎Deprecated
pub fn certificate_source(&self) -> Option<&CertificateSource>
This field is deprecated. Use one of the following fields instead:
-
ACMCertificateArn
-
IAMCertificateId
-
CloudFrontDefaultCertificate
source§impl ViewerCertificate
impl ViewerCertificate
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ViewerCertificate
.
Examples found in repository?
10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226
pub fn deser_structure_crate_model_viewer_certificate(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::ViewerCertificate, aws_smithy_xml::decode::XmlDecodeError> {
#[allow(unused_mut)]
let mut builder = crate::model::ViewerCertificate::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("CloudFrontDefaultCertificate") /* CloudFrontDefaultCertificate com.amazonaws.cloudfront#ViewerCertificate$CloudFrontDefaultCertificate */ => {
let var_398 =
Some(
{
<bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
.map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.cloudfront#boolean`)"))
}
?
)
;
builder = builder.set_cloud_front_default_certificate(var_398);
}
,
s if s.matches("IAMCertificateId") /* IAMCertificateId com.amazonaws.cloudfront#ViewerCertificate$IAMCertificateId */ => {
let var_399 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_iam_certificate_id(var_399);
}
,
s if s.matches("ACMCertificateArn") /* ACMCertificateArn com.amazonaws.cloudfront#ViewerCertificate$ACMCertificateArn */ => {
let var_400 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_acm_certificate_arn(var_400);
}
,
s if s.matches("SSLSupportMethod") /* SSLSupportMethod com.amazonaws.cloudfront#ViewerCertificate$SSLSupportMethod */ => {
let var_401 =
Some(
Result::<crate::model::SslSupportMethod, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::SslSupportMethod::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_ssl_support_method(var_401);
}
,
s if s.matches("MinimumProtocolVersion") /* MinimumProtocolVersion com.amazonaws.cloudfront#ViewerCertificate$MinimumProtocolVersion */ => {
let var_402 =
Some(
Result::<crate::model::MinimumProtocolVersion, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::MinimumProtocolVersion::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_minimum_protocol_version(var_402);
}
,
s if s.matches("Certificate") /* Certificate com.amazonaws.cloudfront#ViewerCertificate$Certificate */ => {
let var_403 =
Some(
Result::<std::string::String, aws_smithy_xml::decode::XmlDecodeError>::Ok(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
.into()
)
?
)
;
builder = builder.set_certificate(var_403);
}
,
s if s.matches("CertificateSource") /* CertificateSource com.amazonaws.cloudfront#ViewerCertificate$CertificateSource */ => {
let var_404 =
Some(
Result::<crate::model::CertificateSource, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::CertificateSource::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_certificate_source(var_404);
}
,
_ => {}
}
}
Ok(builder.build())
}
Trait Implementations§
source§impl Clone for ViewerCertificate
impl Clone for ViewerCertificate
source§fn clone(&self) -> ViewerCertificate
fn clone(&self) -> ViewerCertificate
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more